Enable find/emplace for key types other than KeyT.
authorDaniel Andersson <koda@fb.com>
Tue, 1 Dec 2015 15:46:00 +0000 (07:46 -0800)
committerfacebook-github-bot-0 <folly-bot@fb.com>
Tue, 1 Dec 2015 16:20:22 +0000 (08:20 -0800)
commit4e5cb0efba9454e3abb2dd203116ed8e9a056468
treecefc61ff002b5651095a221c98c98651042b52d0
parentdefa24cf873444cfde710aba4ad8cb392697f4a8
Enable find/emplace for key types other than KeyT.

Summary: Add template parameters to support arbitrary types when looking up a key.

This is useful to avoid the cost of 'materializing' a key which is likely to be present in the array (or, alternatively, switching on a tagged union KeyT).

Use the new capability to greatly simplify the lookup logic in HHVMs static string table.

Reviewed By: nbronson

Differential Revision: D2662451

fb-gh-sync-id: 707fa033f350b80ca8080af17f1a8a74c59f2e88
folly/AtomicHashArray-inl.h
folly/AtomicHashArray.h
folly/AtomicHashMap-inl.h
folly/AtomicHashMap.h
folly/test/AtomicHashArrayTest.cpp
folly/test/AtomicHashMapTest.cpp