summaryrefslogtreecommitdiffstats
path: root/searchcommon
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-11-21 13:58:31 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-11-22 00:27:05 +0000
commit84b04793f98cd6af2a7ca48e344bb48bbcf79727 (patch)
treeef0d4f3ee2d43eefe03e07f666ca5693a2123716 /searchcommon
parentefd711cc8836a4748fc7a8184d51c0371cd98774 (diff)
Avoid creating many instances of rather large methods.
Diffstat (limited to 'searchcommon')
-rw-r--r--searchcommon/src/vespa/searchcommon/common/schema.cpp5
-rw-r--r--searchcommon/src/vespa/searchcommon/common/schema.h8
2 files changed, 10 insertions, 3 deletions
diff --git a/searchcommon/src/vespa/searchcommon/common/schema.cpp b/searchcommon/src/vespa/searchcommon/common/schema.cpp
index 3215a25e55f..673d78fbc89 100644
--- a/searchcommon/src/vespa/searchcommon/common/schema.cpp
+++ b/searchcommon/src/vespa/searchcommon/common/schema.cpp
@@ -164,6 +164,8 @@ Schema::Field::Field(const std::vector<vespalib::string> & lines)
{
}
+Schema::Field::~Field() { }
+
void
Schema::Field::write(vespalib::asciistream & os, const vespalib::stringref & prefix) const
{
@@ -268,6 +270,7 @@ Schema::FieldSet::FieldSet(const std::vector<vespalib::string> & lines) :
}
}
+Schema::FieldSet::~FieldSet() { }
bool
Schema::FieldSet::operator==(const FieldSet &rhs) const
@@ -304,6 +307,8 @@ Schema::Schema()
{
}
+Schema::~Schema() { }
+
bool
Schema::loadFromFile(const vespalib::stringref & fileName)
{
diff --git a/searchcommon/src/vespa/searchcommon/common/schema.h b/searchcommon/src/vespa/searchcommon/common/schema.h
index 5f5b7dd3656..dcc559f6293 100644
--- a/searchcommon/src/vespa/searchcommon/common/schema.h
+++ b/searchcommon/src/vespa/searchcommon/common/schema.h
@@ -72,7 +72,7 @@ public:
**/
Field(const std::vector<vespalib::string> & lines);
- virtual ~Field() {}
+ virtual ~Field();
void setTimestamp(fastos::TimeStamp ts) { _timestamp = ts; }
@@ -85,8 +85,7 @@ public:
CollectionType getCollectionType() const { return _collectionType; }
fastos::TimeStamp getTimestamp() const { return _timestamp; }
- bool matchingTypes(const Field &rhs) const
- {
+ bool matchingTypes(const Field &rhs) const {
return getDataType() == rhs.getDataType() &&
getCollectionType() == rhs.getCollectionType();
}
@@ -155,6 +154,8 @@ public:
**/
FieldSet(const std::vector<vespalib::string> & lines);
+ ~FieldSet();
+
FieldSet &addField(const vespalib::stringref &fieldName) {
_fields.push_back(fieldName);
return *this;
@@ -188,6 +189,7 @@ public:
* Create an initially empty schema
**/
Schema();
+ ~Schema();
/**
* Load this schema from the file with the given name.