Merge ' Remove unnecessary schema copies' from Piotr

Most of the time schema does not have to be copied and sometimes it's not even used.

tests: unit(dev)
Closes #5739

* hawk/remove_schema_copies:
  multishard_mutation_query_test: stop capturing unused schema
  index_reader: avoid copying schema to lambda
This commit is contained in:
Piotr Sarna
2020-02-06 15:20:24 +01:00
2 changed files with 2 additions and 2 deletions

View File

@@ -597,7 +597,7 @@ private:
}
const schema& s = *_sstable->_schema;
auto cmp_with_start = [pos_cmp = promoted_index_block_compare(s), s]
auto cmp_with_start = [pos_cmp = promoted_index_block_compare(s), &s]
(position_in_partition_view pos, const promoted_index_block& info) -> bool {
return pos_cmp(pos, info.start(s));
};

View File

@@ -646,7 +646,7 @@ generate_clustering_ranges(RandomEngine& rnd_engine, const schema& schema, const
start = end;
}
clustering_key_ranges.emplace_back(clustering_index_range.transform([schema, &all_cks] (int i) {
clustering_key_ranges.emplace_back(clustering_index_range.transform([&all_cks] (int i) {
return all_cks.at(i);
}));
} while (start < end);