File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -129,25 +129,22 @@ static inline ut32 ht_default_hash_string(const char *key, ut32 len) {
129129 ut64 result = 0xff51afd7ed558ccdULL ;
130130
131131 while (len >= 16 ) {
132- ut64 blocks [2 ];
133- memcpy (blocks , key , sizeof (ut64 ) * 2 );
134- result += (result << 5 ) ^ (blocks [0 ] * prime1 );
135- result += (result << 5 ) ^ (blocks [1 ] * prime1 );
132+ ut128 block = rz_read_le128 (key );
133+ result += (result << 5 ) ^ (block .Low * prime1 );
134+ result += (result << 5 ) ^ (block .High * prime1 );
136135 len -= 16 ;
137136 key += 16 ;
138137 }
139138
140139 while (len >= 8 ) {
141- ut64 block = 0 ;
142- memcpy (& block , key , sizeof (ut64 ));
140+ ut64 block = rz_read_le64 (key );
143141 result += (result << 5 ) ^ (block * prime1 );
144142 len -= 8 ;
145143 key += 8 ;
146144 }
147145
148146 while (len >= 4 ) {
149- ut32 block = 0 ;
150- memcpy (& block , key , sizeof (ut32 ));
147+ ut32 block = rz_read_le32 (key );
151148 result += (result << 5 ) ^ (block * prime1 );
152149 len -= 4 ;
153150 key += 4 ;
You can’t perform that action at this time.
0 commit comments