folly: kill StringPieceHash
authorLucian Grijincu <lucian@fb.com>
Wed, 5 Oct 2016 20:46:42 +0000 (13:46 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Wed, 5 Oct 2016 20:53:38 +0000 (13:53 -0700)
Summary: no uses remain in folly

Reviewed By: yfeldblum

Differential Revision: D3972507

fbshipit-source-id: 356ddbcf24c217b0f589989ab6cc3910d0f7baf3

folly/Range.h
folly/test/HashTest.cpp

index 07e1513f72f655ad5028b7d420ad2c089c941d4f..0ca0f6150aa6a69c6b48158033e1483dda699a13 100644 (file)
@@ -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
  */
index e2c8e38adfc86fe0cdb5768e41627bdc1735c836..c3c0f17db37564b9cb526c396e47b555479a3945 100644 (file)
@@ -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));