summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-07-10 20:38:07 +0000
committerArne Juul <arnej@verizonmedia.com>2020-07-15 15:39:22 +0000
commit6abfeaca106f70daa32616dbec4ed39b2b9bb35c (patch)
tree415d9544fc3f841491d441297bc6812eadf4690f /searchlib
parent66bf4ff20707a67df5fbbe2d10076947dcfd8c44 (diff)
avoid evil setSpec implementation
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/common/location.cpp11
-rw-r--r--searchlib/src/vespa/searchlib/common/location.h1
3 files changed, 5 insertions, 13 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp
index 37480d6dbd4..f549885e94d 100644
--- a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp
@@ -248,13 +248,13 @@ public:
LocationPostFilterBlueprint(const FieldSpec &field, const IAttributeVector &attribute, const Location &loc)
: ComplexLeafBlueprint(field),
_attribute(attribute),
- _location()
+ _location(loc)
{
+ uint32_t estHits = 0;
if (loc.isValid()) {
_location.setVec(attribute);
- _location.setSpec(loc);
+ estHits = _attribute.getNumDocs();
}
- uint32_t estHits = _attribute.getNumDocs();
LOG(debug, "location %s in attribute with numdocs %u", loc.getDebugString().c_str(), estHits);
HitEstimate estimate(estHits, estHits == 0);
setEstimate(estimate);
diff --git a/searchlib/src/vespa/searchlib/common/location.cpp b/searchlib/src/vespa/searchlib/common/location.cpp
index 51476658953..d88c3ae7302 100644
--- a/searchlib/src/vespa/searchlib/common/location.cpp
+++ b/searchlib/src/vespa/searchlib/common/location.cpp
@@ -8,17 +8,10 @@ namespace search::common {
Location::Location() : _zBoundingBox(0,0,0,0) {}
Location::Location(const GeoLocationSpec &other)
- : Location()
-{
- setSpec(other);
-}
-
-void
-Location::setSpec(const GeoLocationSpec &other)
+ : GeoLocationSpec(other),
+ _zBoundingBox(0,0,0,0)
{
using vespalib::geo::ZCurve;
-
- GeoLocationSpec::operator=(other);
if (isValid()) {
_zBoundingBox = ZCurve::BoundingBox(getMinX(), getMaxX(),
getMinY(), getMaxY());
diff --git a/searchlib/src/vespa/searchlib/common/location.h b/searchlib/src/vespa/searchlib/common/location.h
index 29f3c71fdb5..df8f130ce70 100644
--- a/searchlib/src/vespa/searchlib/common/location.h
+++ b/searchlib/src/vespa/searchlib/common/location.h
@@ -24,7 +24,6 @@ public:
bool getzFailBoundingBoxTest(int64_t docxy) const {
return _zBoundingBox.getzFailBoundingBoxTest(docxy);
}
- void setSpec(const GeoLocationSpec& other);
private:
vespalib::geo::ZCurve::BoundingBox _zBoundingBox;
};