]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson: do not capture unused variables
authorKefu Chai <kchai@redhat.com>
Sun, 5 Jan 2020 14:15:24 +0000 (22:15 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 5 Jan 2020 14:27:03 +0000 (22:27 +0800)
to silence warnings like

src/crimson/net/Socket.cc:93:41: warning: lambda capture 'this' is not
used [-Wunused-lambda-capture]
    return in.read_exactly(bytes).then([this](auto buf) {
                                        ^~~~

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/mon/MonClient.cc
src/crimson/net/Interceptor.h
src/crimson/net/Socket.cc

index 8aa0b2589d0a7d131db1002042bc64b92bf21b71..117b9b3ebd8eb4a387273d01c2030023b87d1243 100644 (file)
@@ -1,3 +1,5 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+
 #include "MonClient.h"
 
 #include <random>
@@ -988,10 +990,10 @@ seastar::future<> Client::reopen_session(int rank)
       found->reset();
       auto ret = seastar::do_with(
        std::move(pending_conns),
-       [this](auto &pending_conns) {
+       [](auto &pending_conns) {
          return seastar::parallel_for_each(
            pending_conns,
-           [this] (auto &conn) {
+           [] (auto &conn) {
              if (!conn) {
                return seastar::now();
              } else {
index 858be0a38e0371a2428cc800b7de2b92fd84d076..fcd3ea6f469cf89b8e59f853e65089b7af7bbd22 100644 (file)
@@ -62,7 +62,7 @@ class socket_blocker {
       return seastar::now();
     } else {
       p_blocked = seastar::abort_source();
-      return seastar::sleep_abortable(10s, *p_blocked).then([this] {
+      return seastar::sleep_abortable(10s, *p_blocked).then([] {
         throw std::runtime_error(
             "Timeout (10s) in socket_blocker::wait_blocked()");
       }).handle_exception_type([] (const seastar::sleep_aborted& e) {
@@ -78,7 +78,7 @@ class socket_blocker {
     }
     ceph_assert(!p_unblocked);
     p_unblocked = seastar::abort_source();
-    return seastar::sleep_abortable(10s, *p_unblocked).then([this] {
+    return seastar::sleep_abortable(10s, *p_unblocked).then([] {
       ceph_abort("Timeout (10s) in socket_blocker::block()");
     }).handle_exception_type([] (const seastar::sleep_aborted& e) {
       // wait done!
index 43affbbdf79e4051333013b10fcd3cd78b73f2e1..4effb94ee8e75a1936e2e3620424bd3957c73db3 100644 (file)
@@ -90,7 +90,7 @@ Socket::read_exactly(size_t bytes) {
     if (bytes == 0) {
       return seastar::make_ready_future<seastar::temporary_buffer<char>>();
     }
-    return in.read_exactly(bytes).then([this](auto buf) {
+    return in.read_exactly(bytes).then([](auto buf) {
       if (buf.empty()) {
         throw std::system_error(make_error_code(error::read_eof));
       }