diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-06-01 12:20:41 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-06-01 15:32:58 +0200 |
commit | f8ce3307a63b5c5d8ad8aaadfcce92e602b0cae7 (patch) | |
tree | 1fb8b8a5e10b55d97e23791d8e028a9e5cc19bdb /searchsummary | |
parent | 25829c28d04e811c46366eb57de584d042961619 (diff) |
Reduce fastos.h dependency.
Diffstat (limited to 'searchsummary')
4 files changed, 29 insertions, 28 deletions
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp index f964eafb2c9..5e6f2ffb3d9 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp @@ -1,9 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "docsumformat.h" +#include <cassert> -namespace search { -namespace docsummary { +namespace search::docsummary { size_t DocsumFormat::addByte(search::RawBuf &target, uint8_t value) @@ -98,5 +98,4 @@ DocsumFormat::addEmpty(ResType type, search::RawBuf &target) return 0; } -} // namespace docsummary -} // namespace search +}
\ No newline at end of file diff --git a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp index 5b38a00fa3b..4b7e3c49cf5 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp @@ -41,6 +41,28 @@ KeywordExtractor::~KeywordExtractor() } } +KeywordExtractor::IndexPrefix::IndexPrefix(const char *prefix, IndexPrefix **list) + : _prefix(NULL), + _prefixLen(0), + _next(NULL) +{ + _prefix = strdup(prefix); + assert(_prefix != NULL); + _prefixLen = strlen(prefix); + _next = *list; + *list = this; +} + +KeywordExtractor::IndexPrefix::~IndexPrefix() +{ + free(_prefix); +} + +bool +KeywordExtractor::IndexPrefix::Match(const char *idxName) const +{ + return (strncmp(idxName, _prefix, _prefixLen) == 0); +} void KeywordExtractor::AddLegalIndexSpec(const char *spec) diff --git a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h index a276b5bf38a..5ee598d98d9 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h +++ b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h @@ -31,29 +31,9 @@ public: int _prefixLen; IndexPrefix *_next; - - IndexPrefix(const char *prefix, - IndexPrefix **list) - : _prefix(NULL), - _prefixLen(0), - _next(NULL) - { - _prefix = strdup(prefix); - assert(_prefix != NULL); - _prefixLen = strlen(prefix); - _next = *list; - *list = this; - } - - ~IndexPrefix() - { - free(_prefix); - } - - bool Match(const char *idxName) const - { - return (strncmp(idxName, _prefix, _prefixLen) == 0); - } + IndexPrefix(const char *prefix, IndexPrefix **list); + ~IndexPrefix(); + bool Match(const char *idxName) const; }; private: diff --git a/searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp b/searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp index 9c28861eee6..ba63d2cd6a1 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp @@ -1,8 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #include "resultclass.h" #include "resultconfig.h" +#include <cassert> #include <zlib.h> namespace search { |