diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-04-01 16:57:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-01 16:57:15 +0200 |
commit | 3ef8559840350529ff4106e2eeaee63cccbbad7c (patch) | |
tree | 35896f07e6f7a82db3bb37b67e541f6778406ba1 /searchlib/src | |
parent | 9fbec96922b71e136ffe47e44c0c2b0a8f81c5e4 (diff) | |
parent | 09bfa76885058f2ceb97597666106c6527a92b4e (diff) |
Merge pull request #21937 from vespa-engine/toregge/remove-dead-code-from-stringbase
Remove dead code from stringbase.cpp
Diffstat (limited to 'searchlib/src')
-rw-r--r-- | searchlib/src/vespa/searchlib/attribute/stringbase.cpp | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/stringbase.cpp b/searchlib/src/vespa/searchlib/attribute/stringbase.cpp index 35299400107..355e14bee45 100644 --- a/searchlib/src/vespa/searchlib/attribute/stringbase.cpp +++ b/searchlib/src/vespa/searchlib/attribute/stringbase.cpp @@ -18,73 +18,6 @@ namespace search { IMPLEMENT_IDENTIFIABLE_ABSTRACT(StringAttribute, AttributeVector); -class SortDataChar { -public: - SortDataChar() { } - SortDataChar(const char *s) : _data(s), _pos(0) { } - operator const char * () const { return _data; } - bool operator != (const vespalib::string & b) const { return b != _data; } - const char * _data; - uint32_t _pos; -}; - -class SortDataCharRadix -{ -public: - uint32_t operator () (SortDataChar & a) const { - uint32_t r(0); - const uint8_t *u((const uint8_t *)(a._data)); - if (u[a._pos]) { - r |= u[a._pos + 0] << 24; - if (u[a._pos + 1]) { - r |= u[a._pos + 1] << 16; - if (u[a._pos + 2]) { - r |= u[a._pos + 2] << 8; - if (u[a._pos + 3]) { - r |= u[a._pos + 3]; - a._pos += 4; - } else { - a._pos += 3; - } - } else { - a._pos += 2; - } - } else { - a._pos += 1; - } - } - return r; - } -}; - -class StdSortDataCharCompare -{ -public: - bool operator() (const SortDataChar & x, const SortDataChar & y) const { - return cmp(x, y) < 0; - } - int cmp(const SortDataChar & a, const SortDataChar & b) const { - int retval = strcmp(a._data, b._data); - return retval; - } -}; - -class SortDataCharEof -{ -public: - bool operator () (const SortDataChar & a) const { return a._data[a._pos] == 0; } - static bool alwaysEofOnCheck() { return false; } -}; - -class StringSorter { -public: - typedef const char * constcharp; - void operator() (SortDataChar * start, size_t sz) const { - vespalib::Array<uint32_t> radixScratchPad(sz); - search::radix_sort(SortDataCharRadix(), StdSortDataCharCompare(), SortDataCharEof(), 1, start, sz, &radixScratchPad[0], 0, 32); - } -}; - size_t StringAttribute::countZero(const char * bt, size_t sz) { |