efficient / libcuckoo

A high-performance, concurrent hash table
Other
1.61k stars 275 forks source link

Return vas value in function returning void #120

Closed ddarkarchon closed 4 years ago

ddarkarchon commented 4 years ago
  void num_remaining_lazy_rehash_locks(size_type n) const {
    return num_remaining_lazy_rehash_locks_.store(
        n, std::memory_order_release);
    if (n == 0) {
      old_buckets_.clear_and_deallocate();
    }
  }

The return statement in num_remaining_lazy_rehash_locks() function seems unnecessary and causes "oldbuckets.clear_and_deallocate()" to never run.

Please advise.

manugoyal commented 4 years ago

Good catch! I got rid of the unnecessary return in 3c24c03a18fd3ba33896a4dc2128c74b07b1dfd2. Correctness and performance seem unchanged.