Skip to content

Commit d659621

Browse files
authored
Merge pull request #4100 from jwpeterson/final_mix
Rename internal hashing routine from final() -> final_mix()
2 parents 16f4fa3 + 536a38e commit d659621

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

include/utils/hashword.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void mix(uint32_t & a, uint32_t & b, uint32_t & c)
8080
* http://burtleburtle.net/bob/hash/index.html
8181
*/
8282
inline
83-
void final(uint32_t & a, uint32_t & b, uint32_t & c)
83+
void final_mix(uint32_t & a, uint32_t & b, uint32_t & c)
8484
{
8585
c ^= b; c -= rot(b,14);
8686
a ^= c; a -= rot(c,11);
@@ -181,7 +181,7 @@ uint32_t hashword(const uint32_t * k, size_t length, uint32_t initval=0)
181181
case 2 : b+=k[1];
182182
libmesh_fallthrough();
183183
case 1 : a+=k[0];
184-
final(a,b,c);
184+
final_mix(a,b,c);
185185
libmesh_fallthrough();
186186
default: // case 0: nothing left to add
187187
break;
@@ -221,7 +221,7 @@ uint32_t hashword2(const uint32_t & first, const uint32_t & second, uint32_t ini
221221

222222
b+=second;
223223
a+=first;
224-
final(a,b,c);
224+
final_mix(a,b,c);
225225

226226
return c;
227227
}
@@ -281,14 +281,14 @@ uint64_t hashword(const uint64_t * k, size_t length)
281281

282282
/**
283283
* In a personal communication from Bob Jenkins, he recommended using
284-
* "Probably final() from lookup3.c... You could hash up to 6 16-bit
284+
* "Probably final_mix() from lookup3.c... You could hash up to 6 16-bit
285285
* integers that way. The output is c, or the top or bottom 16 bits
286286
* of c if you only need 16 bit hash values." [JWP]
287287
*/
288288
inline
289289
uint16_t hashword(const uint16_t * k, size_t length)
290290
{
291-
// Three values that will be passed to final() after they are initialized.
291+
// Three values that will be passed to final_mix() after they are initialized.
292292
uint32_t a = 0;
293293
uint32_t b = 0;
294294
uint32_t c = 0;
@@ -297,7 +297,7 @@ uint16_t hashword(const uint16_t * k, size_t length)
297297
{
298298
case 3:
299299
{
300-
// Cast the inputs to 32 bit integers and call final().
300+
// Cast the inputs to 32 bit integers and call final_mix().
301301
a = k[0];
302302
b = k[1];
303303
c = k[2];
@@ -306,7 +306,7 @@ uint16_t hashword(const uint16_t * k, size_t length)
306306
case 4:
307307
{
308308
// Combine the 4 16-bit inputs, "w, x, y, z" into two 32-bit
309-
// inputs "wx" and "yz" using bit operations and call final.
309+
// inputs "wx" and "yz" using bit operations and call final_mix.
310310
a = ((k[0]<<16) | (k[1] & 0xffff)); // wx
311311
b = ((k[2]<<16) | (k[3] & 0xffff)); // yz
312312
break;
@@ -316,7 +316,7 @@ uint16_t hashword(const uint16_t * k, size_t length)
316316
}
317317

318318
// Result is returned in c
319-
final(a,b,c);
319+
final_mix(a,b,c);
320320
return static_cast<uint16_t>(c);
321321
}
322322

0 commit comments

Comments
 (0)