Skip to content

Commit

Permalink
HeapArray: Fix swap() not swapping size
Browse files Browse the repository at this point in the history
Even though it's not used.
  • Loading branch information
stenzek committed Apr 27, 2024
1 parent f1f4bac commit 5477f2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/common/heap_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ class DynamicHeapArray

void fill(const_reference value) { std::fill(begin(), end(), value); }

void swap(this_type& move) { std::swap(m_data, move.m_data); }
void swap(this_type& rhs)
{
std::swap(m_data, rhs.m_data);
std::swap(m_size, rhs.m_size);
}

void resize(size_t new_size) { internal_resize(new_size, m_data, m_size); }

Expand Down

0 comments on commit 5477f2e

Please sign in to comment.