Skip to content

Commit

Permalink
Fix: Hash table should not clear entries in reset()
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenick committed Dec 1, 2015
1 parent 1944158 commit 629390d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hash_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ size_t CaseInsensitiveHashTable<T>::add(const T& entry) {

template<class T>
void CaseInsensitiveHashTable<T>::set_entries(const EntryVec& entries) {
entries_.clear();
reset(entries.size());
for (size_t i = 0; i < entries.size(); ++i) {
add(entries[i]);
Expand Down Expand Up @@ -220,7 +221,6 @@ void CaseInsensitiveHashTable<T>::reset(size_t capacity) {
size_t index_capacity = next_pow_2(static_cast<size_t>(capacity / CASS_LOAD_FACTOR) + 1);
std::fill(index_.begin(), index_.end(), static_cast<T*>(NULL)); // Clear the old entries
index_.resize(index_capacity);
entries_.clear();
entries_.reserve(capacity);
index_mask_ = index_capacity - 1;
}
Expand Down

0 comments on commit 629390d

Please sign in to comment.