Browse Source

Use bool cast for testing optional<> value

We don't need the call to has_value, we can do it in the if directly.
changes/91/636791/1
Monty Taylor 3 months ago
parent
commit
b4c96c2094
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      zuul-preview/main.cc

+ 1
- 2
zuul-preview/main.cc View File

@@ -104,8 +104,7 @@ int main(int, char**)
104 104
     // site.688b70499b9a41a08f498ed6e932960c.openstack
105 105
     // site.dbefc23dcc594577a8bfa4db4f9b0a8f.openstack
106 106
 
107
-    auto val = cache.get(hostname);
108
-    if (val.has_value()) {
107
+    if (auto val = cache.get(hostname)) {
109 108
       cout << val.value() << endl;
110 109
       continue;
111 110
     }

Loading…
Cancel
Save