From 6e7654169204838a2f68ee8d24c82e2d7c3d384e Mon Sep 17 00:00:00 2001 From: Lucian Grijincu Date: Wed, 5 Oct 2016 13:46:42 -0700 Subject: [PATCH] folly: kill StringPieceHash Summary: no uses remain in folly Reviewed By: yfeldblum Differential Revision: D3972507 fbshipit-source-id: 356ddbcf24c217b0f589989ab6cc3910d0f7baf3 --- folly/Range.h | 7 ------- folly/test/HashTest.cpp | 5 ----- 2 files changed, 12 deletions(-) diff --git a/folly/Range.h b/folly/Range.h index 07e1513f..0ca0f615 100644 --- a/folly/Range.h +++ b/folly/Range.h @@ -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(str.hash()); - } -}; - /** * Finds substrings faster than brute force by borrowing from Boyer-Moore */ diff --git a/folly/test/HashTest.cpp b/folly/test/HashTest.cpp index e2c8e38a..c3c0f17d 100644 --- a/folly/test/HashTest.cpp +++ b/folly/test/HashTest.cpp @@ -312,12 +312,7 @@ TEST(Hash, Strings) { a4 = "10050525", b4 = "51107040"; Range 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)); -- 2.34.1