Skip to content

Commit

Permalink
fix: move only through active slots when computing distance
Browse files Browse the repository at this point in the history
  • Loading branch information
mhx committed Nov 21, 2023
1 parent 587e9af commit 76ef546
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/dwarfs/detail/multi_queue_block_merger_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ class multi_queue_block_merger_impl : public block_merger_base,

while (active_slots_[ix] && active_slots_[ix].value() != src) {
++distance;
ix = (ix + 1) % active_slots_.size();

do {
ix = (ix + 1) % active_slots_.size();
} while (ix != active_slot_index_ && !active_slots_[ix]);

if (ix == active_slot_index_) {
auto it = std::find(begin(source_queue_), end(source_queue_), src);
Expand Down

0 comments on commit 76ef546

Please sign in to comment.