diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-12-22 13:55:07 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-12-28 19:16:53 +0100 |
commit | e4feb3b3cd7f4eaa6036305c9720746397fa6def (patch) | |
tree | d29b9690b324bbd6495d088513d51c9093c4b002 /vespalib | |
parent | 07e3d0618ab7663aa664e9cb824f166c3f290f10 (diff) |
Expect the happy path.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/stllike/hashtable.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vespalib/src/vespa/vespalib/stllike/hashtable.hpp b/vespalib/src/vespa/vespalib/stllike/hashtable.hpp index ada3f455017..57e8dcc4b03 100644 --- a/vespalib/src/vespa/vespalib/stllike/hashtable.hpp +++ b/vespalib/src/vespa/vespalib/stllike/hashtable.hpp @@ -67,9 +67,9 @@ typename hashtable<Key, Value, Hash, Equal, KeyExtract, Modulator>::iterator hashtable<Key, Value, Hash, Equal, KeyExtract, Modulator>::find(const Key & key) { next_t h = hash(key); - if (_nodes[h].valid()) { + if (__builtin_expect(_nodes[h].valid(), true)) { do { - if (_equal(_keyExtractor(_nodes[h].getValue()), key)) { + if (__builtin_expect(_equal(_keyExtractor(_nodes[h].getValue()), key), true)) { return iterator(this, h); } h = _nodes[h].getNext(); @@ -83,9 +83,9 @@ typename hashtable<Key, Value, Hash, Equal, KeyExtract, Modulator>::const_iterat hashtable<Key, Value, Hash, Equal, KeyExtract, Modulator>::find(const Key & key) const { next_t h = hash(key); - if (_nodes[h].valid()) { + if (__builtin_expect(_nodes[h].valid(), true)) { do { - if (_equal(_keyExtractor(_nodes[h].getValue()), key)) { + if (__builtin_expect(_equal(_keyExtractor(_nodes[h].getValue()), key), true)) { return const_iterator(this, h); } h = _nodes[h].getNext(); |