]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
librados: move definition of cct_deleter to .cc
authorKefu Chai <kchai@redhat.com>
Sun, 6 Dec 2020 07:41:49 +0000 (15:41 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 6 Dec 2020 08:36:11 +0000 (16:36 +0800)
so cct->get() and cct->put() are visually closer. this improves the
readability.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/librados/RadosClient.cc
src/librados/RadosClient.h

index 5915e6a147a68b4da353e32e84d913c393f8110e..47b928058c4f565786c81680a97fba68cc3636c6 100644 (file)
@@ -56,7 +56,9 @@ namespace ca = ceph::async;
 namespace cb = ceph::buffer;
 
 librados::RadosClient::RadosClient(CephContext *cct_)
-  : Dispatcher(cct_->get()) {
+  : Dispatcher(cct_->get()),
+    cct_deleter{cct, [](CephContext *p) {p->put();}}
+{
   auto& conf = cct->_conf;
   conf.add_observer(this);
   rados_mon_op_timeout = conf.get_val<std::chrono::seconds>("rados_mon_op_timeout");
index 10d3baea13da9a4c67864777a3f25659b2e24917..0db094b18009439574c6cbc0b41b88ec39d31133 100644 (file)
@@ -50,8 +50,7 @@ public:
   using Dispatcher::cct;
 private:
   std::unique_ptr<CephContext,
-                 std::function<void(CephContext*)> > cct_deleter{
-    cct, [](CephContext *p) {p->put();}};
+                 std::function<void(CephContext*)>> cct_deleter;
 
 public:
   const ConfigProxy& conf{cct->_conf};