diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-11-03 19:27:57 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-11-03 19:27:57 +0000 |
commit | feb5e6ea3ef7b35a8d33949a461477f156c6311b (patch) | |
tree | bafe71677277cac61112c7b1e034ba81a5022445 /searchlib | |
parent | 518744fc78a512f597959959db1fbe08ad828098 (diff) |
Move helper methods to anonymous namespace.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp | 42 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h | 6 |
2 files changed, 24 insertions, 24 deletions
diff --git a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp index 845622a68a6..d1a2c26a75d 100644 --- a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp +++ b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp @@ -3,13 +3,33 @@ #include "stackdumpiterator.h" #include <vespa/vespalib/util/compress.h> #include <vespa/vespalib/objects/nbo.h> -#include <cassert> -#include <charconv> using search::query::PredicateQueryTerm; namespace search { +namespace { + +uint64_t +readUint64(const char *&p) +{ + uint64_t value; + memcpy(&value, p, sizeof(value)); + p += sizeof(value); + return vespalib::nbo::n2h(value); +} + +double +read_double(const char *&p) +{ + double value; + memcpy(&value, p, sizeof(value)); + p += sizeof(value); + return vespalib::nbo::n2h(value); +} + +} + SimpleQueryStackDumpIterator::SimpleQueryStackDumpIterator(vespalib::stringref buf) : _buf(buf.begin()), _bufEnd(buf.end()), @@ -46,24 +66,6 @@ SimpleQueryStackDumpIterator::read_stringref(const char *&p) } uint64_t -SimpleQueryStackDumpIterator::readUint64(const char *&p) -{ - uint64_t value; - memcpy(&value, p, sizeof(value)); - p += sizeof(value); - return vespalib::nbo::n2h(value); -} - -double -SimpleQueryStackDumpIterator::read_double(const char *&p) -{ - double value; - memcpy(&value, p, sizeof(value)); - p += sizeof(value); - return vespalib::nbo::n2h(value); -} - -uint64_t SimpleQueryStackDumpIterator::readCompressedPositiveInt(const char *&p) { uint64_t tmp; diff --git a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h index 2f862de46fe..dece4ecc0b6 100644 --- a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h +++ b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.h @@ -48,8 +48,6 @@ private: query::PredicateQueryTerm::UP _predicate_query_term; VESPA_DLL_LOCAL vespalib::stringref read_stringref(const char *&p); - VESPA_DLL_LOCAL uint64_t readUint64(const char *&p); - VESPA_DLL_LOCAL double read_double(const char *&p); VESPA_DLL_LOCAL uint64_t readCompressedPositiveInt(const char *&p); VESPA_DLL_LOCAL bool readPredicate(const char *&p); VESPA_DLL_LOCAL bool readNN(const char *&p); @@ -60,12 +58,12 @@ public: /** * Make an iterator on a buffer. To get the first item, next must be called. */ - SimpleQueryStackDumpIterator(vespalib::stringref buf); + explicit SimpleQueryStackDumpIterator(vespalib::stringref buf); SimpleQueryStackDumpIterator(const SimpleQueryStackDumpIterator &) = delete; SimpleQueryStackDumpIterator& operator=(const SimpleQueryStackDumpIterator &) = delete; ~SimpleQueryStackDumpIterator(); - vespalib::stringref getStack() const { return vespalib::stringref(_buf, _bufEnd - _buf); } + vespalib::stringref getStack() const noexcept { return vespalib::stringref(_buf, _bufEnd - _buf); } size_t getPosition() const { return _currPos; } /** |