Skip to content

Commit

Permalink
Fix compilation warning on temporary variable (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tessil committed Oct 10, 2023
1 parent 7ab2fa0 commit 71e3ed4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions include/tsl/sparse_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -2047,9 +2047,7 @@ class sparse_hash : private Allocator,

template <typename K>
void insert_on_rehash(K &&key_value) {
const key_type &key = KeySelect()(key_value);

const std::size_t hash = hash_key(key);
const std::size_t hash = hash_key(KeySelect()(key_value));
std::size_t ibucket = bucket_for_hash(hash);

std::size_t probe = 0;
Expand All @@ -2065,9 +2063,10 @@ class sparse_hash : private Allocator,

return;
} else {
tsl_sh_assert(!compare_keys(
key, KeySelect()(*m_sparse_buckets[sparse_ibucket].value(
index_in_sparse_bucket))));
tsl_sh_assert(
!compare_keys(KeySelect()(key_value),
KeySelect()(*m_sparse_buckets[sparse_ibucket].value(
index_in_sparse_bucket))));
}

probe++;
Expand Down

0 comments on commit 71e3ed4

Please sign in to comment.