From b4c96c2094d8b65e81c856bd4548c84ff0502074 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 11 Feb 2019 15:21:54 +0000 Subject: [PATCH] Use bool cast for testing optional<> value We don't need the call to has_value, we can do it in the if directly. --- zuul-preview/main.cc | 3 +-- 1 file changed, 1 insertion(+), 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**) // site.688b70499b9a41a08f498ed6e932960c.openstack // site.dbefc23dcc594577a8bfa4db4f9b0a8f.openstack - auto val = cache.get(hostname); - if (val.has_value()) { + if (auto val = cache.get(hostname)) { cout << val.value() << endl; continue; }