Use the full hash as a filter to reduce # strcmps
llvm-svn: 39057
This commit is contained in:
parent
893f272c39
commit
341fd06d3c
|
@ -187,6 +187,7 @@ IdentifierInfo &IdentifierTable::get(const char *NameStart,
|
|||
for (IdentifierBucket *Identifier = IdentHead, *LastID = 0; Identifier;
|
||||
LastID = Identifier, Identifier = Identifier->Next) {
|
||||
if (Identifier->TokInfo.getNameLength() == Length &&
|
||||
Identifier->TokInfo.HashValue == FullHash &&
|
||||
memcmp(Identifier->TokInfo.getName(), NameStart, Length) == 0) {
|
||||
// If found identifier wasn't at start of bucket, move it there so
|
||||
// that frequently searched for identifiers are found earlier, even if
|
||||
|
|
Loading…
Reference in New Issue