FcCharSetHash(): use the 'numbers' values to compute the hash

Before this commit, FcCharSetHash() repeatedly used the address of the
'numbers' array of an FcCharSet to compute the FcCharSet hash, instead
of the value of each array element. This is not good for even spreading
of the FcCharSet objects among the various buckets of the hash table
(and should thus reduce performance). This bug appears to have been
mistakenly introduced in commit
cd2ec1a940 (June 2005).
This commit is contained in:
Florent Rougon 2017-06-05 10:58:41 +02:00 committed by Akira TAGOH
parent 28139816d6
commit c37eeb8f1f
1 changed files with 1 additions and 1 deletions

View File

@ -1113,7 +1113,7 @@ FcCharSetHash (FcCharSet *fcs)
hash = ((hash << 1) | (hash >> 31)) ^ FcCharLeafHash (FcCharSetLeaf(fcs,i));
/* hash in numbers */
for (i = 0; i < fcs->num; i++)
hash = ((hash << 1) | (hash >> 31)) ^ *FcCharSetNumbers(fcs);
hash = ((hash << 1) | (hash >> 31)) ^ FcCharSetNumbers(fcs)[i];
return hash;
}