diff --git a/include/momo/details/HashBucketOpen2N2.h b/include/momo/details/HashBucketOpen2N2.h index 2ff0d7c2..20e7c695 100644 --- a/include/momo/details/HashBucketOpen2N2.h +++ b/include/momo/details/HashBucketOpen2N2.h @@ -47,28 +47,25 @@ namespace internal typedef BucketParamsOpen Params; private: - template - struct HashData; + typedef typename UIntSelector::UInt ShortHash; - template - struct HashData + template + struct HashData { - union - { - uint16_t shortHashes[count]; - uint8_t hashProbes[count]; - }; + ShortHash shortHashes[codeCount]; + uint8_t hashProbes[codeCount]; }; - template - struct HashData + template + struct HashData { - uint8_t shortHashes[count]; - uint8_t hashProbes[count]; + union + { + ShortHash shortHashes[codeCount]; + uint8_t hashProbes[codeCount]; + }; }; - typedef typename UIntSelector::UInt ShortHash; - static const size_t hashCodeShift = sizeof(size_t) * 8 - sizeof(ShortHash) * 8 + 1; static const ShortHash emptyShortHash = ShortHash{1} << (sizeof(ShortHash) * 8 - 1); static const uint8_t emptyHashProbe = 255; @@ -257,7 +254,7 @@ namespace internal private: uint8_t mState[2]; - HashData mHashData; + HashData<> mHashData; ObjectBuffer mItems; }; } diff --git a/include/momo/details/TreeNode.h b/include/momo/details/TreeNode.h index 52e32a86..2007d3f9 100644 --- a/include/momo/details/TreeNode.h +++ b/include/momo/details/TreeNode.h @@ -46,20 +46,17 @@ namespace internal private: typedef BoolConstant IsContinuous; - template - struct Counter; - - template - struct Counter + template + struct Counter { uint8_t count; + uint8_t indexes[indexCount]; }; template - struct Counter + struct Counter { uint8_t count; - uint8_t indexes[capacity]; }; typedef internal::MemManagerPtr MemManagerPtr;