Commit 6e765416 authored by Lucian Grijincu's avatar Lucian Grijincu Committed by Facebook Github Bot

folly: kill StringPieceHash

Summary: no uses remain in folly

Reviewed By: yfeldblum

Differential Revision: D3972507

fbshipit-source-id: 356ddbcf24c217b0f589989ab6cc3910d0f7baf3
parent f701dbad
......@@ -972,13 +972,6 @@ operator>=(const T& lhs, const U& rhs) {
return StringPiece(lhs) >= StringPiece(rhs);
}
// Do NOT use this, use SpookyHashV2 instead, see commment on hash() above.
struct StringPieceHash {
std::size_t operator()(const StringPiece str) const {
return static_cast<std::size_t>(str.hash());
}
};
/**
* Finds substrings faster than brute force by borrowing from Boyer-Moore
*/
......
......@@ -312,12 +312,7 @@ TEST(Hash, Strings) {
a4 = "10050525", b4 = "51107040";
Range<const wchar_t*> w1 = range(L"10050517"), w2 = range(L"51107032"),
w3 = range(L"10050518"), w4 = range(L"51107033");
StringPieceHash h1;
Hash h2;
EXPECT_EQ(h1(a1), h1(b1));
EXPECT_EQ(h1(a2), h1(b2));
EXPECT_EQ(h1(a3), h1(b3));
EXPECT_EQ(h1(a4), h1(b4));
EXPECT_NE(h2(a1), h2(b1));
EXPECT_NE(h2(a1), h2(b1));
EXPECT_NE(h2(a2), h2(b2));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment