diff --git a/sstables/compaction.cc b/sstables/compaction.cc index c004c70b0f..9712c1725f 100644 --- a/sstables/compaction.cc +++ b/sstables/compaction.cc @@ -94,7 +94,7 @@ static api::timestamp_type get_max_purgeable_timestamp(schema_ptr schema, static bool belongs_to_current_node(const dht::token& t, const std::vector>& sorted_owned_ranges) { auto low = std::lower_bound(sorted_owned_ranges.begin(), sorted_owned_ranges.end(), t, - [] (const range& a, const dht::token b) { + [] (const range& a, const dht::token& b) { // check that range a is before token b. return a.after(b, dht::token_comparator()); }); @@ -212,18 +212,6 @@ future<> compact_sstables(std::vector sstables, column_family& c std::vector> owned_ranges; if (cleanup) { owned_ranges = service::get_local_storage_service().get_local_ranges(schema->ks_name()); - // sort owned ranges - std::sort(owned_ranges.begin(), owned_ranges.end(), [](range& a, range& b) { - if (!a.start()) { - return true; - } - if (!b.start()) { - return false; - } - const dht::token& a_start = a.start()->value(); - const dht::token& b_start = b.start()->value(); - return a_start < b_start; - }); } auto reader = make_mutation_reader(schema, std::move(readers), std::move(not_compacted_sstables), std::move(owned_ranges), cleanup);