Commit 4cfa8dfe authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

Use base::FastHash() in //base

base::Hash() is deprecated and is being replaced by base::FastHash().
The output of base::FastHash() is only fixed within the lifetime of a
single process, so if the code depends on the mapping of inputs to hash
outputs not changing over time, base::PersistentHash() must be used
instead.

Bug: 1025358
Change-Id: I1b1a46ce59260bb0c9f41a32f8e96f88ff8bf260
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954454
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722465}
parent 2ff4b390
...@@ -133,7 +133,7 @@ template <> ...@@ -133,7 +133,7 @@ template <>
struct hash<::base::Location> { struct hash<::base::Location> {
std::size_t operator()(const ::base::Location& loc) const { std::size_t operator()(const ::base::Location& loc) const {
const void* program_counter = loc.program_counter(); const void* program_counter = loc.program_counter();
return base::Hash(&program_counter, sizeof(void*)); return base::FastHash(base::as_bytes(base::make_span(&program_counter, 1)));
} }
}; };
......
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