Skip to content

Commit

Permalink
table: Avoid reallocations in make_compaction_groups()
Browse files Browse the repository at this point in the history
Signed-off-by: Raphael S. Carvalho <[email protected]>
  • Loading branch information
raphaelsc committed Apr 25, 2023
1 parent 9f5e192 commit 59904be
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions replica/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ void table::enable_off_strategy_trigger() {
std::vector<std::unique_ptr<compaction_group>> table::make_compaction_groups() {
std::vector<std::unique_ptr<compaction_group>> ret;
auto&& ranges = dht::split_token_range_msb(_x_log2_compaction_groups);
ret.reserve(ranges.size());
tlogger.debug("Created {} compaction groups for {}.{}", ranges.size(), _schema->ks_name(), _schema->cf_name());
for (auto&& range : ranges) {
ret.emplace_back(std::make_unique<compaction_group>(*this, std::move(range)));
Expand Down

0 comments on commit 59904be

Please sign in to comment.