summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <tegge@vespa.ai>2023-12-04 13:55:57 +0100
committerGitHub <noreply@github.com>2023-12-04 13:55:57 +0100
commit5a6f4144dd7e90c773102f80f194d3bbbc41ddae (patch)
treed696bd8b0b65deccceabac8114598e860281b95a
parentefc756b8d2fd1a822cb199c959e9aa9acf2c2456 (diff)
parent79fa60286c827ab5167a094feaf63ebba57c80c4 (diff)
Merge pull request #29542 from vespa-engine/toregge/use-getrange-member-function-to-get-range
Use templated getRange() member function to get range.
-rw-r--r--streamingvisitors/src/vespa/vsm/searcher/floatfieldsearcher.cpp6
-rw-r--r--streamingvisitors/src/vespa/vsm/searcher/floatfieldsearcher.h2
-rw-r--r--streamingvisitors/src/vespa/vsm/searcher/intfieldsearcher.cpp6
-rw-r--r--streamingvisitors/src/vespa/vsm/searcher/intfieldsearcher.h2
4 files changed, 6 insertions, 10 deletions
diff --git a/streamingvisitors/src/vespa/vsm/searcher/floatfieldsearcher.cpp b/streamingvisitors/src/vespa/vsm/searcher/floatfieldsearcher.cpp
index 95ebdfe9a90..7dd40348f47 100644
--- a/streamingvisitors/src/vespa/vsm/searcher/floatfieldsearcher.cpp
+++ b/streamingvisitors/src/vespa/vsm/searcher/floatfieldsearcher.cpp
@@ -39,10 +39,8 @@ void FloatFieldSearcherT<T>::prepare(search::streaming::QueryTermList& qtl,
for (auto qt : qtl) {
size_t sz(qt->termLen());
if (sz) {
- double low;
- double high;
- bool valid = qt->getAsDoubleTerm(low, high);
- _floatTerm.push_back(FloatInfo(low, high, valid));
+ auto range = qt->getRange<T>();
+ _floatTerm.emplace_back(range.low, range.high, range.valid);
}
}
}
diff --git a/streamingvisitors/src/vespa/vsm/searcher/floatfieldsearcher.h b/streamingvisitors/src/vespa/vsm/searcher/floatfieldsearcher.h
index 38bb6704c3b..07b3f6e1c5f 100644
--- a/streamingvisitors/src/vespa/vsm/searcher/floatfieldsearcher.h
+++ b/streamingvisitors/src/vespa/vsm/searcher/floatfieldsearcher.h
@@ -20,7 +20,7 @@ protected:
class FloatInfo
{
public:
- FloatInfo(T low, T high, bool v) : _lower(low), _upper(high), _valid(v) { }
+ FloatInfo(T low, T high, bool v) noexcept : _lower(low), _upper(high), _valid(v) { }
bool cmp(T key) const;
bool valid() const { return _valid; }
void setValid(bool v) { _valid = v; }
diff --git a/streamingvisitors/src/vespa/vsm/searcher/intfieldsearcher.cpp b/streamingvisitors/src/vespa/vsm/searcher/intfieldsearcher.cpp
index 4a941cecb83..e73c7f5c1a7 100644
--- a/streamingvisitors/src/vespa/vsm/searcher/intfieldsearcher.cpp
+++ b/streamingvisitors/src/vespa/vsm/searcher/intfieldsearcher.cpp
@@ -29,10 +29,8 @@ void IntFieldSearcher::prepare(search::streaming::QueryTermList& qtl,
for (auto qt : qtl) {
size_t sz(qt->termLen());
if (sz) {
- int64_t low;
- int64_t high;
- bool valid = qt->getAsIntegerTerm(low, high);
- _intTerm.push_back(IntInfo(low, high, valid));
+ auto range = qt->getRange<int64_t>();
+ _intTerm.emplace_back(range.low, range.high, range.valid);
}
}
}
diff --git a/streamingvisitors/src/vespa/vsm/searcher/intfieldsearcher.h b/streamingvisitors/src/vespa/vsm/searcher/intfieldsearcher.h
index 845fd2721cf..47b83c1538d 100644
--- a/streamingvisitors/src/vespa/vsm/searcher/intfieldsearcher.h
+++ b/streamingvisitors/src/vespa/vsm/searcher/intfieldsearcher.h
@@ -20,7 +20,7 @@ protected:
class IntInfo
{
public:
- IntInfo(int64_t low, int64_t high, bool v) : _lower(low), _upper(high), _valid(v) { }
+ IntInfo(int64_t low, int64_t high, bool v) noexcept : _lower(low), _upper(high), _valid(v) { }
bool cmp(int64_t key) const { return (_lower <= key) && (key <= _upper); }
bool valid() const { return _valid; }
private: