summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2019-02-11 15:21:54 +0000
committerMonty Taylor <mordred@inaugust.com>2019-02-11 15:21:54 +0000
commitb4c96c2094d8b65e81c856bd4548c84ff0502074 (patch)
treeee4f72669cb52edc6ef6d377062a1c693f763b1d
parentf463a6c794b73a6f5958780e47de6e461ae1b4c5 (diff)
Use bool cast for testing optional<> value
We don't need the call to has_value, we can do it in the if directly.
-rw-r--r--zuul-preview/main.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/zuul-preview/main.cc b/zuul-preview/main.cc
index 79e655d..de73683 100644
--- a/zuul-preview/main.cc
+++ b/zuul-preview/main.cc
@@ -104,8 +104,7 @@ int main(int, char**)
104 // site.688b70499b9a41a08f498ed6e932960c.openstack 104 // site.688b70499b9a41a08f498ed6e932960c.openstack
105 // site.dbefc23dcc594577a8bfa4db4f9b0a8f.openstack 105 // site.dbefc23dcc594577a8bfa4db4f9b0a8f.openstack
106 106
107 auto val = cache.get(hostname); 107 if (auto val = cache.get(hostname)) {
108 if (val.has_value()) {
109 cout << val.value() << endl; 108 cout << val.value() << endl;
110 continue; 109 continue;
111 } 110 }