Commit c816aeff authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Rename IOBufEqual to IOBufEqualTo

Summary: [Folly] Rename `IOBufEqual` to `IOBufEqualTo` to correspond with the standard naming of `std::equal_to`.

Reviewed By: Orvid

Differential Revision: D7596716

fbshipit-source-id: 2e87aa4b62a002520bdd53b5b7eaba7d9bd822da
parent ad317726
...@@ -1028,7 +1028,7 @@ size_t IOBufHash::operator()(const IOBuf& buf) const { ...@@ -1028,7 +1028,7 @@ size_t IOBufHash::operator()(const IOBuf& buf) const {
return h1; return h1;
} }
bool IOBufEqual::operator()(const IOBuf& a, const IOBuf& b) const { bool IOBufEqualTo::operator()(const IOBuf& a, const IOBuf& b) const {
io::Cursor ca(&a); io::Cursor ca(&a);
io::Cursor cb(&b); io::Cursor cb(&b);
for (;;) { for (;;) {
......
...@@ -1424,7 +1424,7 @@ struct IOBufHash { ...@@ -1424,7 +1424,7 @@ struct IOBufHash {
/** /**
* Equality predicate for IOBuf objects. Compares data in the entire chain. * Equality predicate for IOBuf objects. Compares data in the entire chain.
*/ */
struct IOBufEqual { struct IOBufEqualTo {
bool operator()(const IOBuf& a, const IOBuf& b) const; bool operator()(const IOBuf& a, const IOBuf& b) const;
bool operator()(const std::unique_ptr<IOBuf>& a, bool operator()(const std::unique_ptr<IOBuf>& a,
const std::unique_ptr<IOBuf>& b) const { const std::unique_ptr<IOBuf>& b) const {
......
...@@ -48,7 +48,7 @@ class TestWriteChainAsyncTransportWrapper : ...@@ -48,7 +48,7 @@ class TestWriteChainAsyncTransportWrapper :
}; };
MATCHER_P(BufMatches, expected, "") { MATCHER_P(BufMatches, expected, "") {
folly::IOBufEqual eq; folly::IOBufEqualTo eq;
return eq(*arg, *expected); return eq(*arg, *expected);
} }
......
...@@ -445,7 +445,7 @@ TEST(IOBuf, cloneAndInsert) { ...@@ -445,7 +445,7 @@ TEST(IOBuf, cloneAndInsert) {
} }
TEST(IOBuf, cloneWithEmptyBufAtStart) { TEST(IOBuf, cloneWithEmptyBufAtStart) {
folly::IOBufEqual eq; folly::IOBufEqualTo eq;
auto empty = IOBuf::create(0); auto empty = IOBuf::create(0);
auto hel = IOBuf::create(3); auto hel = IOBuf::create(3);
append(hel, "hel"); append(hel, "hel");
......
...@@ -1044,7 +1044,7 @@ std::unique_ptr<IOBuf> fromStr(StringPiece sp) { ...@@ -1044,7 +1044,7 @@ std::unique_ptr<IOBuf> fromStr(StringPiece sp) {
} // namespace } // namespace
TEST(IOBuf, HashAndEqual) { TEST(IOBuf, HashAndEqual) {
folly::IOBufEqual eq; folly::IOBufEqualTo eq;
folly::IOBufHash hash; folly::IOBufHash hash;
EXPECT_TRUE(eq(nullptr, nullptr)); EXPECT_TRUE(eq(nullptr, nullptr));
......
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