OSDN Git Service

[Support] Replace HashString with djbHash.
authorJonas Devlieghere <jonas@devlieghere.com>
Mon, 26 Feb 2018 11:30:13 +0000 (11:30 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Mon, 26 Feb 2018 11:30:13 +0000 (11:30 +0000)
commit3abbc00c8f01041fc1b8971ff1ede5e0681c9ee3
tree343c8da1c8e8add8d2eb38a0ed0af3c787b00b50
parentecfbbe9f5fe887edf28909a0109604ef98c960f5
[Support] Replace HashString with djbHash.

This removes the HashString function from StringExtraces and replaces
its uses with calls to djbHash from DJB.h

This is *almost* NFC. While the algorithm is identical, the djbHash
implementation in StringExtras used 0 as its seed while the
implementation in DJB uses 5381. The latter has been shown to result in
less collisions and improved avalanching.

https://reviews.llvm.org/D43615
(cherry picked from commit 77f7f965bc9499a9ae768a296ca5a1f7347d1d2c)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326081 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/StringExtras.h
lib/Support/StringMap.cpp