summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahoo-inc.com>2017-02-08 10:23:15 +0000
committerTor Egge <Tor.Egge@yahoo-inc.com>2017-02-08 10:23:15 +0000
commitb9643984bb6a795f9b96542d3c69ce756276e27e (patch)
tree226543eb69bfd8824c77be85ff83ef0a4668fd54 /searchlib
parent1d2fda3acf3035d628aa71bcb82bbcb88f09d5ad (diff)
Prepare for faster lid mapping:
- Remove unneeded reference in AddResult class.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/datastore/unique_store.h10
-rw-r--r--searchlib/src/vespa/searchlib/datastore/unique_store.hpp4
2 files changed, 3 insertions, 11 deletions
diff --git a/searchlib/src/vespa/searchlib/datastore/unique_store.h b/searchlib/src/vespa/searchlib/datastore/unique_store.h
index 51982972fc4..90e31a3fa62 100644
--- a/searchlib/src/vespa/searchlib/datastore/unique_store.h
+++ b/searchlib/src/vespa/searchlib/datastore/unique_store.h
@@ -69,17 +69,14 @@ public:
DictionaryTraits>;
class AddResult {
EntryRef _ref;
- EntryType &_value;
bool _inserted;
public:
- AddResult(EntryRef ref_, EntryType &value_, bool inserted_)
+ AddResult(EntryRef ref_, bool inserted_)
: _ref(ref_),
- _value(value_),
_inserted(inserted_)
{
}
EntryRef ref() const { return _ref; }
- EntryType &value() { return _value; }
bool inserted() { return _inserted; }
};
private:
@@ -89,11 +86,6 @@ private:
Dictionary _dict;
using generation_t = vespalib::GenerationHandler::generation_t;
- EntryType &getWritable(EntryRef ref)
- {
- RefType iRef(ref);
- return *_store.template getBufferEntry<EntryType>(iRef.bufferId(), iRef.offset());
- }
public:
UniqueStore();
~UniqueStore();
diff --git a/searchlib/src/vespa/searchlib/datastore/unique_store.hpp b/searchlib/src/vespa/searchlib/datastore/unique_store.hpp
index d3424e17a45..2ec05ee9248 100644
--- a/searchlib/src/vespa/searchlib/datastore/unique_store.hpp
+++ b/searchlib/src/vespa/searchlib/datastore/unique_store.hpp
@@ -50,12 +50,12 @@ UniqueStore<EntryT, RefT>::add(const EntryType &value)
assert(refCount != std::numeric_limits<uint32_t>::max());
itr.writeData(refCount + 1);
RefType iRef(itr.getKey());
- return AddResult(itr.getKey(), getWritable(itr.getKey()), false);
+ return AddResult(itr.getKey(), false);
} else {
EntryRef newRef = _store.template allocator<EntryType>(_typeId).alloc(value).ref;
_dict.insert(itr, newRef, 1u);
- return AddResult(newRef, getWritable(newRef), true);
+ return AddResult(newRef, true);
}
}