From d00c228409aa8f06da2eef23ede1edeff1fc0fa0 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Tue, 12 May 2015 14:02:46 -0400 Subject: [PATCH] sstables: turn some column parser fields static They don't depend on internal state (or can be made not to). We want to reuse those fields later for detecting static columns in tombstones. Signed-off-by: Glauber Costa --- sstables/partition.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sstables/partition.cc b/sstables/partition.cc index e7e9e7a512..324d74d5f3 100644 --- a/sstables/partition.cc +++ b/sstables/partition.cc @@ -87,13 +87,13 @@ class mp_row_consumer : public row_consumer { static constexpr size_t static_size = 2; - bool check_static(bytes_view col) const { + static bool check_static(bytes_view col) { static bytes static_row(static_size, 0xff); return col.compare(0, static_size, static_row) == 0; } - bytes_view fix_static_name(bytes_view col) { - if (is_static) { + static bytes_view fix_static_name(bytes_view col) { + if (check_static(col)) { col.remove_prefix(static_size); } return col;