summaryrefslogtreecommitdiff
path: root/klm/util/probing_hash_table.hh
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-11-07 18:10:00 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2011-11-07 18:10:00 -0500
commitc2b05499ffa82cfadc668e140b8f96ab43b1c715 (patch)
tree696f234835b7758bbb6f6b528d6bdbef1f6193e5 /klm/util/probing_hash_table.hh
parentbcda3258ab35cba2f71e28e1c93863958f5aca8b (diff)
parentbdd7fe7b513ade0b979fc050766e375044e84e86 (diff)
Merge branch 'master' of github.com:redpony/cdec
Diffstat (limited to 'klm/util/probing_hash_table.hh')
-rw-r--r--klm/util/probing_hash_table.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/klm/util/probing_hash_table.hh b/klm/util/probing_hash_table.hh
index 2ec342a6..8122d69c 100644
--- a/klm/util/probing_hash_table.hh
+++ b/klm/util/probing_hash_table.hh
@@ -61,14 +61,14 @@ template <class PackingT, class HashT, class EqualT = std::equal_to<typename Pac
#endif
{}
- template <class T> void Insert(const T &t) {
+ template <class T> MutableIterator Insert(const T &t) {
if (++entries_ >= buckets_)
UTIL_THROW(ProbingSizeException, "Hash table with " << buckets_ << " buckets is full.");
#ifdef DEBUG
assert(initialized_);
#endif
for (MutableIterator i(begin_ + (hash_(t.GetKey()) % buckets_));;) {
- if (equal_(i->GetKey(), invalid_)) { *i = t; return; }
+ if (equal_(i->GetKey(), invalid_)) { *i = t; return i; }
if (++i == end_) { i = begin_; }
}
}