]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rbd_mirror: Remove unneded implicit conversions
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 17 Jul 2020 06:12:38 +0000 (02:12 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 17 Jul 2020 18:18:17 +0000 (14:18 -0400)
Since we're comparing to uint64_ts and storing in a uint64_t, just
have the variable be a uint64_t.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.cc
src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc

index 216a2fa2caf96b0e9511bd5bdfa49dd284352b3e..eb99d5addbd7df22fc9e25b4efdafbaeb14a97ae 100644 (file)
@@ -263,14 +263,13 @@ void ReplayStatusFormatter<I>::format(std::string *description) {
   root_obj["entries_per_second"] = round_to_two_places(entries_per_second);
 
   if (m_entries_behind_master > 0 && entries_per_second > 0) {
-    auto seconds_until_synced = round_to_two_places(
+    std::uint64_t seconds_until_synced = round_to_two_places(
       m_entries_behind_master / entries_per_second);
     if (seconds_until_synced >= std::numeric_limits<uint64_t>::max()) {
       seconds_until_synced = std::numeric_limits<uint64_t>::max();
     }
 
-    root_obj["seconds_until_synced"] = static_cast<uint64_t>(
-      seconds_until_synced);
+    root_obj["seconds_until_synced"] = seconds_until_synced;
   }
 
   *description = json_spirit::write(
index 6c4d842f1fd5e39237e029821e2a32428d7cfe01..d2c8ee27278e7c08ab2657cab916171b8f9bf311 100644 (file)
@@ -273,14 +273,13 @@ bool Replayer<I>::get_replay_status(std::string* description,
 
   auto pending_bytes = bytes_per_snapshot * m_pending_snapshots;
   if (bytes_per_second > 0 && m_pending_snapshots > 0) {
-    auto seconds_until_synced = round_to_two_places(
+    std::uint64_t seconds_until_synced = round_to_two_places(
       pending_bytes / bytes_per_second);
     if (seconds_until_synced >= std::numeric_limits<uint64_t>::max()) {
       seconds_until_synced = std::numeric_limits<uint64_t>::max();
     }
 
-    root_obj["seconds_until_synced"] = static_cast<uint64_t>(
-      seconds_until_synced);
+    root_obj["seconds_until_synced"] = seconds_until_synced;
   }
 
   *description = json_spirit::write(