From e1945e473bd2f4dbed63de2e8a13ceac66ee5488 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Tue, 11 Aug 2015 19:18:25 -0500 Subject: [PATCH] row consumer: make non_consuming an instance member It is now a static member that gets the instance members as parameters. There is no reason for that, and this will complicate the decoupling, since the prestate reader won't know about state. Signed-off-by: Glauber Costa Reviewed-by: Nadav Har'El --- sstables/row.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sstables/row.cc b/sstables/row.cc index d1269b1a0a..e2ad57e08c 100644 --- a/sstables/row.cc +++ b/sstables/row.cc @@ -58,11 +58,11 @@ private: // action when finishing to read a primitive type via a prestate, in // the rare case that a primitive type crossed a buffer). Such // non-consuming states need to run even if the data buffer is empty. - static bool non_consuming(state s, prestate ps) { - return (((s == state::DELETION_TIME_3) - || (s == state::CELL_VALUE_BYTES_2) - || (s == state::ATOM_START_2) - || (s == state::EXPIRING_CELL_3)) && (ps == prestate::NONE)); + bool non_consuming() const { + return (((_state == state::DELETION_TIME_3) + || (_state == state::CELL_VALUE_BYTES_2) + || (_state == state::ATOM_START_2) + || (_state == state::EXPIRING_CELL_3)) && (_prestate == prestate::NONE)); } // state for non-NONE prestates uint32_t _pos; @@ -230,7 +230,7 @@ public: return row_consumer::proceed::yes; } #endif - while (data || non_consuming(_state, _prestate)) { + while (data || non_consuming()) { if (_prestate != prestate::NONE) { // We're in the middle of reading a basic type, which crossed // an input buffer. Resume that read before continuing to