From 7ebfc7ef99d8813da086bbddce1b578cccb09ff3 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Tue, 19 May 2015 22:34:38 -0400 Subject: [PATCH] sstables: use a key_view instead of a key in the converter Now we can explode key_views, let's use it instead of a key. Signed-off-by: Glauber Costa Reviewed-by: Nadav Har'El --- sstables/partition.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sstables/partition.cc b/sstables/partition.cc index 825dcf70b9..6048c06ed9 100644 --- a/sstables/partition.cc +++ b/sstables/partition.cc @@ -83,7 +83,7 @@ static inline bytes pop_back(std::vector& vec) { class mp_row_consumer : public row_consumer { schema_ptr _schema; - key _key; + key_view _key; struct column { bool is_static; @@ -235,9 +235,8 @@ public: } virtual void consume_row_start(sstables::key_view key, sstables::deletion_time deltime) override { - key_view k(_key); - if (key != k) { - throw malformed_sstable_exception(sprint("Key mismatch. Got %s while processing %s", to_hex(bytes_view(key)).c_str(), to_hex(bytes_view(k)).c_str())); + if (key != _key) { + throw malformed_sstable_exception(sprint("Key mismatch. Got %s while processing %s", to_hex(bytes_view(key)).c_str(), to_hex(bytes_view(_key)).c_str())); } if (!deltime.live()) {