diff --git a/keys.hh b/keys.hh index baf8a18c51..d5346c4d2e 100644 --- a/keys.hh +++ b/keys.hh @@ -571,7 +571,7 @@ public: }; class partition_key : public compound_wrapper { - explicit partition_key(bytes&& b) + explicit partition_key(managed_bytes&& b) : compound_wrapper(std::move(b)) { } public: @@ -590,13 +590,13 @@ public: partition_key& operator=(partition_key&&) = default; partition_key(partition_key_view key) - : partition_key(bytes(key.representation().begin(), key.representation().end())) + : partition_key(managed_bytes(key.representation())) { } using compound = lw_shared_ptr; - static partition_key from_bytes(bytes b) { - return partition_key(std::move(b)); + static partition_key from_bytes(bytes_view b) { + return partition_key(managed_bytes(b)); } static const compound& get_compound_type(const schema& s) { @@ -659,7 +659,7 @@ public: }; class clustering_key_prefix : public prefix_compound_wrapper { - explicit clustering_key_prefix(bytes&& b) + explicit clustering_key_prefix(managed_bytes&& b) : prefix_compound_wrapper(std::move(b)) { } public: @@ -676,13 +676,13 @@ public: clustering_key_prefix& operator=(clustering_key_prefix&&) = default; clustering_key_prefix(clustering_key_prefix_view v) - : clustering_key_prefix(bytes(v.representation().begin(), v.representation().end())) + : clustering_key_prefix(managed_bytes(v.representation())) { } using compound = lw_shared_ptr>; - static clustering_key_prefix from_bytes(bytes b) { - return clustering_key_prefix(std::move(b)); + static clustering_key_prefix from_bytes(bytes_view b) { + return clustering_key_prefix(managed_bytes(b)); } static const compound& get_compound_type(const schema& s) { diff --git a/query-result-reader.hh b/query-result-reader.hh index 676bb183a7..44105457fe 100644 --- a/query-result-reader.hh +++ b/query-result-reader.hh @@ -164,7 +164,7 @@ public: while (in.has_next()) { auto row_count = in.read(); if (slice.options.contains()) { - auto key = partition_key::from_bytes(to_bytes(in.read_view_to_blob())); + auto key = partition_key::from_bytes(in.read_view_to_blob()); visitor.accept_new_partition(key, row_count); } else { visitor.accept_new_partition(row_count); @@ -178,7 +178,7 @@ public: while (row_count--) { if (slice.options.contains()) { - auto key = clustering_key::from_bytes(to_bytes(in.read_view_to_blob())); + auto key = clustering_key::from_bytes(in.read_view_to_blob()); result_row_view row(in.read_view_to_blob(), slice); visitor.accept_new_row(key, static_row, row); } else {