diff options
author | Adam C. Emerson <aemerson@redhat.com> | 2020-07-17 08:12:38 +0200 |
---|---|---|
committer | Adam C. Emerson <aemerson@redhat.com> | 2020-07-17 20:18:17 +0200 |
commit | 37961b07c4828fa2678f11c1839768f534a3e2c7 (patch) | |
tree | debc03e50379c0b7536117b21c3aaa7cd6e7b485 /src/tools | |
parent | rgw: Fix braced initializer warning (diff) | |
download | ceph-37961b07c4828fa2678f11c1839768f534a3e2c7.tar.xz ceph-37961b07c4828fa2678f11c1839768f534a3e2c7.zip |
rbd_mirror: Remove unneded implicit conversions
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>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.cc | 5 | ||||
-rw-r--r-- | src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.cc b/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.cc index 216a2fa2caf..eb99d5addbd 100644 --- a/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.cc +++ b/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.cc @@ -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( diff --git a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc index 6c4d842f1fd..d2c8ee27278 100644 --- a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc +++ b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc @@ -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( |