aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-08-29 14:10:46 +0200
committerGitHub <noreply@github.com>2022-08-29 14:10:46 +0200
commit55cdc7134bd1d13a402d58f91d8196138a2debee (patch)
tree8056718ebbf3459d01563f9b1501b4316a4cb1eb /searchlib
parent4238dccd76549ffffdfb1c1be90898ece6451d34 (diff)
parent91a1b02e5b7e387005577af36ae37c8553f38cd4 (diff)
Merge pull request #23827 from vespa-engine/toregge/reduce-use-of-new-in-summary-field-converter-unit-test
Reduce use of new in summary field converter unit test.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/index/docbuilder.cpp25
1 files changed, 5 insertions, 20 deletions
diff --git a/searchlib/src/vespa/searchlib/index/docbuilder.cpp b/searchlib/src/vespa/searchlib/index/docbuilder.cpp
index d4bf9e86c74..bf0a6866a1a 100644
--- a/searchlib/src/vespa/searchlib/index/docbuilder.cpp
+++ b/searchlib/src/vespa/searchlib/index/docbuilder.cpp
@@ -111,21 +111,6 @@ insertRaw(const Schema::Field & sfield,
rfvalue->setValue(static_cast<const char *>(buf), len);
}
-
-template <typename T>
-std::unique_ptr<T>
-make_UP(T *p)
-{
- return std::unique_ptr<T>(p);
-}
-
-template <typename T>
-std::unique_ptr<T>
-makeUP(T *p)
-{
- return std::unique_ptr<T>(p);
-}
-
}
namespace docbuilderkludge
@@ -154,10 +139,10 @@ using namespace docbuilderkludge;
namespace {
-std::unique_ptr<Annotation>
+Annotation
makeTokenType(linguistics::TokenType type)
{
- return std::make_unique<Annotation>(*AnnotationType::TOKEN_TYPE, std::make_unique<IntFieldValue>(type));
+ return Annotation(*AnnotationType::TOKEN_TYPE, std::make_unique<IntFieldValue>(type));
}
}
@@ -337,7 +322,7 @@ DocBuilder::IndexFieldHandle::addTokenizedString(const vespalib::string &val,
void
DocBuilder::IndexFieldHandle::addSpan(size_t start, size_t len)
{
- const SpanNode &span = _spanList->add(makeUP(new Span(start, len)));
+ const SpanNode &span = _spanList->add(std::make_unique<Span>(start, len));
_lastSpan = &span;
}
@@ -388,8 +373,8 @@ DocBuilder::IndexFieldHandle::addTermAnnotation(const vespalib::string &val)
assert(_spanTree);
assert(_lastSpan != nullptr);
_spanTree->annotate(*_lastSpan,
- makeUP(new Annotation(*AnnotationType::TERM,
- makeUP(new StringFieldValue(val)))));
+ Annotation(*AnnotationType::TERM,
+ std::make_unique<StringFieldValue>(val)));
}
void