Commit b1a0a138 authored by Giuseppe Ottaviano's avatar Giuseppe Ottaviano 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

Differential Revision: D8304491

fbshipit-source-id: 9988e9012c31b894746488494dd644054492def3
parent 7a46e6ee
......@@ -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