diff options
author | Max Kellermann <max.kellermann@ionos.com> | 2024-10-08 12:48:03 +0200 |
---|---|---|
committer | Max Kellermann <max.kellermann@ionos.com> | 2024-10-09 23:15:15 +0200 |
commit | 342a25b9df13319ff6cd661eab1c546229ce0e14 (patch) | |
tree | b57743988a2a6ad92276b0c4f90dbca48d2caf3a /src/msg/async/ProtocolV2.cc | |
parent | msg/async/ProtocolV[12]: use `auto` (diff) | |
download | ceph-342a25b9df13319ff6cd661eab1c546229ce0e14.tar.xz ceph-342a25b9df13319ff6cd661eab1c546229ce0e14.zip |
msg/async/ProtocolV[12]: reverse the std::map sort order
This allows eliminating one lookup in `_get_next_outgoing()` because
we can pass the iterator instead of the key to `erase()`.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Diffstat (limited to 'src/msg/async/ProtocolV2.cc')
-rw-r--r-- | src/msg/async/ProtocolV2.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 7e6e2ec0d87..463b9b84191 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -508,13 +508,13 @@ ProtocolV2::out_queue_entry_t ProtocolV2::_get_next_outgoing() { out_queue_entry_t out_entry; if (!out_queue.empty()) { - auto it = out_queue.rbegin(); + auto it = out_queue.begin(); auto& entries = it->second; ceph_assert(!entries.empty()); out_entry = entries.front(); entries.pop_front(); if (entries.empty()) { - out_queue.erase(it->first); + out_queue.erase(it); } } return out_entry; |