Skip to content
Commit 318d35a7 authored by Kwasi Mensah's avatar Kwasi Mensah
Browse files

[libc++] Check hash before calling __hash_table key_eq function

Summary: The current implementations of __hash_table::find used by std::unordered_set/unordered_map call key_eq on each key that lands in the same bucket as the key you're looking for. However, since equal objects mush hash to the same value, you can short-circuit the possibly expensive call to key_eq by checking the hashes first.

Reviewers: EricWF

Subscribers: kmensah, cfe-commits

Differential Revision: http://reviews.llvm.org/D21510

llvm-svn: 274857
parent 3202f065
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment