summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-08-15 12:06:26 +0200
committerHenning Baldersheim <balder@oath.com>2018-08-15 12:06:26 +0200
commit59f371688d0b8d9f662c37530f6968b9fd12cd9d (patch)
tree9a7d5f969ac02a4c073c1f35d4e0835a160f87fd /searchlib
parentf515632ca718c475c573ce760c58d64ff786f8a6 (diff)
Remove unused code.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/common/resultset.cpp29
-rw-r--r--searchlib/src/vespa/searchlib/common/resultset.h14
2 files changed, 7 insertions, 36 deletions
diff --git a/searchlib/src/vespa/searchlib/common/resultset.cpp b/searchlib/src/vespa/searchlib/common/resultset.cpp
index 20c636df77c..cdf20ff3882 100644
--- a/searchlib/src/vespa/searchlib/common/resultset.cpp
+++ b/searchlib/src/vespa/searchlib/common/resultset.cpp
@@ -16,32 +16,9 @@ ResultSet::ResultSet()
_rankedHitsArrayAllocElements(0u),
_bitOverflow(),
_rankedHitsArray()
-{
-}
-
-
-ResultSet::ResultSet(const ResultSet &other)
- : _elemsUsedInRankedHitsArray(0),
- _rankedHitsArrayAllocElements(0),
- _bitOverflow(),
- _rankedHitsArray()
-{
- allocArray(other._elemsUsedInRankedHitsArray);
- _elemsUsedInRankedHitsArray = other._elemsUsedInRankedHitsArray;
- if (_elemsUsedInRankedHitsArray > 0)
- memcpy(_rankedHitsArray.get(),
- other._rankedHitsArray.get(),
- _elemsUsedInRankedHitsArray * sizeof(RankedHit));
-
- if (other._bitOverflow) {
- _bitOverflow = BitVector::create(*other._bitOverflow);
- }
-}
+{}
-
-ResultSet::~ResultSet()
-{
-}
+ResultSet::~ResultSet() = default;
void
@@ -139,7 +116,7 @@ ResultSet::mergeWithBitOverflow(HitRank default_value)
_rankedHitsArrayAllocElements = actualHits;
_elemsUsedInRankedHitsArray = actualHits;
_rankedHitsArray.swap(newHitsAlloc);
- setBitOverflow(NULL);
+ setBitOverflow(nullptr);
}
} // namespace search
diff --git a/searchlib/src/vespa/searchlib/common/resultset.h b/searchlib/src/vespa/searchlib/common/resultset.h
index 60c902b1b12..cdd64b73731 100644
--- a/searchlib/src/vespa/searchlib/common/resultset.h
+++ b/searchlib/src/vespa/searchlib/common/resultset.h
@@ -12,19 +12,16 @@ class BitVector;
class ResultSet
{
private:
- ResultSet& operator=(const ResultSet &);
-
unsigned int _elemsUsedInRankedHitsArray;
unsigned int _rankedHitsArrayAllocElements;
std::unique_ptr<BitVector> _bitOverflow;
vespalib::alloc::Alloc _rankedHitsArray;
-
public:
- typedef std::unique_ptr<ResultSet> UP;
- typedef std::shared_ptr<ResultSet> SP;
+ using UP = std::unique_ptr<ResultSet>;
+ ResultSet& operator=(const ResultSet &) = delete;
+ ResultSet(const ResultSet &) = delete;
ResultSet();
- ResultSet(const ResultSet &); // Used only for testing .....
- virtual ~ResultSet();
+ ~ResultSet();
void allocArray(unsigned int arrayAllocated);
@@ -39,9 +36,6 @@ public:
BitVector * getBitOverflow() { return _bitOverflow.get(); }
unsigned int getNumHits() const;
void mergeWithBitOverflow(HitRank default_value = default_rank_value);
-
- /* isEmpty() is allowed to return false even if bitmap has no hits */
- bool isEmpty() const { return (_bitOverflow && (_elemsUsedInRankedHitsArray == 0)); }
};
} // namespace search