]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use std::optional in bilog trim
authorCasey Bodley <cbodley@redhat.com>
Fri, 12 Apr 2019 19:56:01 +0000 (15:56 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 12 Apr 2019 19:56:04 +0000 (15:56 -0400)
clean up an ugly workaround for a bug in boost::optional

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_sync_log_trim.cc

index cae02600477fa8a1af916b3df1188c0a26de4282..f35e2caf762c66bab375e3f8356731b078b0e516 100644 (file)
@@ -354,9 +354,7 @@ int take_min_status(CephContext *cct, Iter first, Iter last,
                     std::vector<std::string> *status)
 {
   status->clear();
-  // The initialisation below is required to silence a false positive
-  // -Wmaybe-uninitialized warning
-  boost::optional<uint64_t> num_shards = boost::make_optional(false, uint64_t());
+  std::optional<uint64_t> num_shards;
   for (auto peer = first; peer != last; ++peer) {
     const size_t peer_shards = peer->size();
     if (!num_shards) {