Commit e7401c7b authored by Xiao Shi's avatar Xiao Shi Committed by Facebook Github Bot

Use folly Hash to hash strings in dynamic

Summary:
There should be no expectations on what hash is internally used in dynamic, so
we don't need to maintain compatibility with `fbstring`, which hasn't been used
as string storage in `dynamic` for quite a while.

Reviewed By: yfeldblum, ot

Differential Revision: D8824634

fbshipit-source-id: 6765472aeeacb55c68b058f5dcc128f6b400bc95
parent 6b1869e2
......@@ -315,11 +315,8 @@ std::size_t dynamic::hash() const {
return std::hash<double>()(getDouble());
case BOOL:
return std::hash<bool>()(getBool());
case STRING: {
// keep it compatible with FBString
const auto& str = getString();
return ::folly::hash::fnv32_buf(str.data(), str.size());
}
case STRING:
return Hash()(getString());
}
assume_unreachable();
}
......
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