Fix warning.

This commit is contained in:
levlam 2022-11-18 15:19:01 +03:00
parent 47aa5b51c7
commit f1ee808465
2 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ template <class KeyT, class ValueT, class HashT = std::hash<KeyT>, class EqT = s
class WaitFreeHashMap {
static constexpr size_t MAX_STORAGE_COUNT = 1 << 8;
static_assert((MAX_STORAGE_COUNT & (MAX_STORAGE_COUNT - 1)) == 0, "");
static constexpr size_t DEFAULT_STORAGE_SIZE = 1 << 14;
static constexpr uint32 DEFAULT_STORAGE_SIZE = 1 << 14;
FlatHashMap<KeyT, ValueT, HashT, EqT> default_map_;
struct WaitFreeStorage {
@ -43,7 +43,7 @@ class WaitFreeHashMap {
void split_storage() {
CHECK(wait_free_storage_ == nullptr);
wait_free_storage_ = make_unique<WaitFreeStorage>();
auto next_hash_mult = hash_mult_ * 1000000007;
uint32 next_hash_mult = hash_mult_ * 1000000007;
for (uint32 i = 0; i < MAX_STORAGE_COUNT; i++) {
auto &map = wait_free_storage_->maps_[i];
map.hash_mult_ = next_hash_mult;

View File

@ -18,7 +18,7 @@ template <class KeyT, class HashT = std::hash<KeyT>, class EqT = std::equal_to<K
class WaitFreeHashSet {
static constexpr size_t MAX_STORAGE_COUNT = 1 << 8;
static_assert((MAX_STORAGE_COUNT & (MAX_STORAGE_COUNT - 1)) == 0, "");
static constexpr size_t DEFAULT_STORAGE_SIZE = 1 << 14;
static constexpr uint32 DEFAULT_STORAGE_SIZE = 1 << 14;
FlatHashSet<KeyT, HashT, EqT> default_set_;
struct WaitFreeStorage {
@ -43,7 +43,7 @@ class WaitFreeHashSet {
void split_storage() {
CHECK(wait_free_storage_ == nullptr);
wait_free_storage_ = make_unique<WaitFreeStorage>();
auto next_hash_mult = hash_mult_ * 1000000007;
uint32 next_hash_mult = hash_mult_ * 1000000007;
for (uint32 i = 0; i < MAX_STORAGE_COUNT; i++) {
auto &set = wait_free_storage_->sets_[i];
set.hash_mult_ = next_hash_mult;