28.12.2015 16:03, Dimitry Sibiryakov wrote: >>>> Yes. But in this case the hash is only used internally and not stored >>>> anywhere. Because >>>> of this, different platforms can use different algorithms for it. >> Of course, but then it should be encapsulated and moved to /common to >> avoid the same #ifdefs used here and there. This algorithm is used twice >> or thrice in our code, IIRC. > > AFAICS, in other places a little different algorithm is used. It uses > different sum > logic and then division in loop instead of single op.
Really? The one in jrd/lck.cpp is a complete copy, just buggy (= used instead of +=), it was fixed in trunk. And the one in HashJoin.cpp should also be an exact match, as it was copy-pasted. > BTW, does this algorithm have a name to google for? Jim's Hash Function? <g> Dmitry ------------------------------------------------------------------------------ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel