mutation_partition: Add r-value variant of clustered_row()

This commit is contained in:
Tomasz Grabiec
2015-05-07 10:29:09 +02:00
parent a854163f71
commit cc4e2ec622
2 changed files with 12 additions and 0 deletions

View File

@@ -161,6 +161,17 @@ mutation_partition::find_row(const clustering_key& key) const {
return &i->row().cells;
}
deletable_row&
mutation_partition::clustered_row(clustering_key&& key) {
auto i = _rows.find(key);
if (i == _rows.end()) {
auto e = new rows_entry(std::move(key));
_rows.insert(i, *e);
return e->row();
}
return i->row();
}
deletable_row&
mutation_partition::clustered_row(const clustering_key& key) {
auto i = _rows.find(key);

View File

@@ -205,6 +205,7 @@ public:
const row& static_row() const { return _static_row; }
const row_tombstones_type& row_tombstones() const { return _row_tombstones; }
deletable_row& clustered_row(const clustering_key& key);
deletable_row& clustered_row(clustering_key&& key);
deletable_row& clustered_row(const schema& s, const clustering_key_view& key);
const row* find_row(const clustering_key& key) const;
const rows_entry* find_entry(schema_ptr schema, const clustering_key_prefix& key) const;