From 605da68e155564fefd9c1425fe8000d61724448f Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 2 Oct 2019 09:17:12 -0400 Subject: [PATCH] use absl optional --- llarp/util/thread/logic.cpp | 2 +- llarp/util/thread/logic.hpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/llarp/util/thread/logic.cpp b/llarp/util/thread/logic.cpp index 8a6c0d803..b27aa4d87 100644 --- a/llarp/util/thread/logic.cpp +++ b/llarp/util/thread/logic.cpp @@ -109,7 +109,7 @@ namespace llarp bool Logic::can_flush() const { - return id.has_value() && id.value() == std::this_thread::get_id(); + return id.value() == std::this_thread::get_id(); } } // namespace llarp diff --git a/llarp/util/thread/logic.hpp b/llarp/util/thread/logic.hpp index 4373ba0d2..3a7ac25b3 100644 --- a/llarp/util/thread/logic.hpp +++ b/llarp/util/thread/logic.hpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace llarp { @@ -12,7 +13,7 @@ namespace llarp public: struct llarp_threadpool* thread; struct llarp_timer_context* timer; - std::optional< std::thread::id > id; + absl::optional< std::thread::id > id; Logic();