diff --git a/src/Common/HashTable/Hash.h b/src/Common/HashTable/Hash.h index 8e876c6b994..d601d945ccf 100644 --- a/src/Common/HashTable/Hash.h +++ b/src/Common/HashTable/Hash.h @@ -91,39 +91,38 @@ inline UInt32 updateWeakHash32(const DB::UInt8 * pos, size_t size, DB::UInt32 up { if (size < 8) { - DB::UInt64 value = 0; - auto * value_ptr = reinterpret_cast(&value); + UInt64 value = 0; switch (size) { case 0: break; case 1: - __builtin_memcpy(value_ptr, pos, 1); + __builtin_memcpy(&value, pos, 1); break; case 2: - __builtin_memcpy(value_ptr, pos, 2); + __builtin_memcpy(&value, pos, 2); break; case 3: - __builtin_memcpy(value_ptr, pos, 3); + __builtin_memcpy(&value, pos, 3); break; case 4: - __builtin_memcpy(value_ptr, pos, 4); + __builtin_memcpy(&value, pos, 4); break; case 5: - __builtin_memcpy(value_ptr, pos, 5); + __builtin_memcpy(&value, pos, 5); break; case 6: - __builtin_memcpy(value_ptr, pos, 6); + __builtin_memcpy(&value, pos, 6); break; case 7: - __builtin_memcpy(value_ptr, pos, 7); + __builtin_memcpy(&value, pos, 7); break; default: __builtin_unreachable(); } - value_ptr[7] = size; + reinterpret_cast(&value)[7] = size; return intHashCRC32(value, updated_value); } diff --git a/src/Common/SpaceSaving.h b/src/Common/SpaceSaving.h index 390afaac81f..7ad48a6cf87 100644 --- a/src/Common/SpaceSaving.h +++ b/src/Common/SpaceSaving.h @@ -85,7 +85,7 @@ public: struct Counter { - Counter() {} + Counter() = default; //-V730 Counter(const TKey & k, UInt64 c = 0, UInt64 e = 0, size_t h = 0) : key(k), slot(0), hash(h), count(c), error(e) {}