diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-15 11:36:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-15 11:36:29 +0100 |
commit | d4fe7e63855a8fca22a1509f1752ec0611fd71ec (patch) | |
tree | ffffe1f0656cd685e88767ca74498bba24dfb049 | |
parent | 86aaa0a0d010c8d4a44287b279f713b0964b1803 (diff) | |
parent | 39f64445921f49fb1e0cc5a4144a8ce0ee65fcd5 (diff) |
Merge pull request #21691 from vespa-engine/balder/gc-unused-convenience-methods
GC unused convenience methods.
4 files changed, 15 insertions, 27 deletions
diff --git a/document/src/tests/annotation/annotation_test.cpp b/document/src/tests/annotation/annotation_test.cpp index 1e4e216cdc6..2700cfcf96f 100644 --- a/document/src/tests/annotation/annotation_test.cpp +++ b/document/src/tests/annotation/annotation_test.cpp @@ -154,7 +154,7 @@ TEST("requireThatAnnotationsCanHaveValues") { } TEST("requireThatAnnotationsCanReferenceAnnotations") { - SpanList::UP root(new SpanList); + auto root = std::make_unique<SpanList>(); SpanTree tree("html", std::move(root)); size_t san_index = tree.annotate(makeUP(new Annotation(text_type))); size_t fran_index = tree.annotate(makeUP(new Annotation(text_type))); @@ -174,7 +174,6 @@ TEST("requireThatAnnotationsCanReferenceAnnotations") { Annotation city(city_type, std::move(city_data)); ASSERT_TRUE(city.getFieldValue()); - EXPECT_TRUE(city.getFieldValue()->isA(original)); EXPECT_EQUAL(original, *city.getFieldValue()); } diff --git a/document/src/vespa/document/fieldvalue/fieldvalue.cpp b/document/src/vespa/document/fieldvalue/fieldvalue.cpp index c69b7169aa0..cc55775d54c 100644 --- a/document/src/vespa/document/fieldvalue/fieldvalue.cpp +++ b/document/src/vespa/document/fieldvalue/fieldvalue.cpp @@ -48,10 +48,6 @@ FieldValue::hash() const return vespalib::hashValue(os.data(), os.size()) ; } -bool -FieldValue::isA(const FieldValue& other) const { - return (getDataType()->isA(*other.getDataType())); -} int FieldValue::compare(const FieldValue& other) const { return getDataType()->cmpId(*other.getDataType()); @@ -216,7 +212,7 @@ FieldValue::createArray(const DataType & baseType) } std::ostream& operator<<(std::ostream& out, const FieldValue & p) { - p.print(out); + p.print(out, false, ""); return out; } diff --git a/document/src/vespa/document/fieldvalue/fieldvalue.h b/document/src/vespa/document/fieldvalue/fieldvalue.h index fedb0141391..5eadb3307b5 100644 --- a/document/src/vespa/document/fieldvalue/fieldvalue.h +++ b/document/src/vespa/document/fieldvalue/fieldvalue.h @@ -65,9 +65,6 @@ public: /** Get the datatype describing what can be stored in this fieldvalue. */ virtual const DataType *getDataType() const = 0; - /** Wrapper for datatypes isA() function. See DataType. */ - virtual bool isA(const FieldValue& other) const; - void serialize(vespalib::nbostream &stream) const; vespalib::nbostream serialize() const; @@ -171,10 +168,6 @@ public: } virtual void print(std::ostream& out, bool verbose, const std::string& indent) const = 0; - // Duplication to reduce size of FieldValue - void print(std::ostream& out) const { print(out, false, ""); } - void print(std::ostream& out, bool verbose) const { print(out, verbose, ""); } - void print(std::ostream& out, const std::string& indent) const { print(out, false, indent); } /** Utility function to get this output as a string. */ std::string toString(bool verbose=false, const std::string& indent="") const; virtual void printXml(XmlOutputStream& out) const = 0; diff --git a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp index 88f9938cc0a..f00702f2785 100644 --- a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp +++ b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp @@ -239,7 +239,7 @@ private: } void printText(const document::FieldValue &toPrint) { - toPrint.print(std::cout, _verbose); + toPrint.print(std::cout, _verbose, ""); std::cout << std::endl; } @@ -250,9 +250,9 @@ public: _verbose(verbose) { } - virtual void replay(const PutOperation &op) override { + void replay(const PutOperation &op) override { print(op); - if (op.getDocument().get() != NULL) { + if (op.getDocument()) { if (_printXml) { printXml(*op.getDocument()); } else { @@ -260,10 +260,10 @@ public: } } } - virtual void replay(const RemoveOperation &op) override { + void replay(const RemoveOperation &op) override { print(op); } - virtual void replay(const UpdateOperation &op) override { + void replay(const UpdateOperation &op) override { print(op); if (op.getUpdate().get() != NULL) { if (_printXml) { @@ -273,14 +273,14 @@ public: } } } - virtual void replay(const NoopOperation &) override { } - virtual void replay(const NewConfigOperation &) override { } - virtual void replay(const DeleteBucketOperation &) override { } - virtual void replay(const SplitBucketOperation &) override { } - virtual void replay(const JoinBucketsOperation &) override { } - virtual void replay(const PruneRemovedDocumentsOperation &) override { } - virtual void replay(const MoveOperation &) override { } - virtual void replay(const CreateBucketOperation &) override { } + void replay(const NoopOperation &) override { } + void replay(const NewConfigOperation &) override { } + void replay(const DeleteBucketOperation &) override { } + void replay(const SplitBucketOperation &) override { } + void replay(const JoinBucketsOperation &) override { } + void replay(const PruneRemovedDocumentsOperation &) override { } + void replay(const MoveOperation &) override { } + void replay(const CreateBucketOperation &) override { } }; |