]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: use std::option instead stdx::option<>
authorKefu Chai <kchai@redhat.com>
Tue, 9 Oct 2018 07:17:06 +0000 (15:17 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 9 Oct 2018 09:39:39 +0000 (17:39 +0800)
in upstream seastar, "SEASTAR_USE_STD_OPTIONAL_VARIANT_STRINGVIEW" is offered
as an option. if it is set to "1", std::option is used instead of
std::experimental::option. using std::option is more C++17 compliant and simpler.

but we are using a seastar version based on
https://github.com/hakuch/seastar/commits/jhk/better_cmake/v3 , which
enables "SEASTAR_USE_STD_OPTIONAL_VARIANT_STRINGVIEW" by default, if
C++17 is used.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/net/SocketConnection.cc

index 9595cca9e1a050f372fd4ad318360b2d7ee58099..9c669b33228482aa959ca0260f7f320b2d19e125 100644 (file)
@@ -248,14 +248,12 @@ seastar::future<MessageRef> SocketConnection::do_read_message()
 
 seastar::future<MessageRef> SocketConnection::read_message()
 {
-  namespace stdx = std::experimental;
-
   return seastar::repeat_until_value([this] {
       return do_read_message()
-        .then([this] (MessageRef msg) -> stdx::optional<MessageRef> {
+        .then([this] (MessageRef msg) -> std::optional<MessageRef> {
           if (!update_rx_seq(msg->get_seq())) {
             // skip this request and read the next
-            return stdx::nullopt;
+            return {};
           }
           return msg;
         });