Skip to content

Commit

Permalink
logic fix on resize to reset _head and _tail indices
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperlarson committed Aug 4, 2024
1 parent 0a1216b commit 5929df1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/BoundedPriorityDeque.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ class BoundedPriorityDequeBase {
std::move(_buffer.begin() + _head, _buffer.end() + 1, newBuffer.begin());
std::move(_buffer.begin(), _buffer.begin() + _tail + 1, newBuffer.begin() + (_k - _head - 1));
_buffer = newBuffer;
_head = 0;
_tail = _size - 1;
}
}
};
Expand Down

0 comments on commit 5929df1

Please sign in to comment.