Skip to content

Commit

Permalink
Fix swap for incomplete rows
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Aug 27, 2024
1 parent a6804b5 commit d85ab93
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/category.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,12 @@ void category::swap_item(uint16_t item_ix, row_handle &a, row_handle &b)
auto &ra = *a.m_row;
auto &rb = *b.m_row;

while (ra.size() <= item_ix)
ra.emplace_back("");

while (rb.size() <= item_ix)
rb.emplace_back("");

std::swap(ra.at(item_ix), rb.at(item_ix));
}

Expand Down

0 comments on commit d85ab93

Please sign in to comment.