Add [[nodiscard]] decorations to fml::HashCombine. (flutter/engine#27343)

This makes it easier to catch errors when HashCombine was used
instead of HashCombineSeed.
This commit is contained in:
Chinmay Garde 2021-07-13 06:53:25 -07:00 committed by GitHub
parent bf96d4bbc8
commit 17aff107e9

View File

@ -22,12 +22,12 @@ constexpr void HashCombineSeed(std::size_t& seed,
HashCombineSeed(seed, other_args...);
}
constexpr std::size_t HashCombine() {
[[nodiscard]] constexpr std::size_t HashCombine() {
return 0xdabbad00;
}
template <class... Type>
constexpr std::size_t HashCombine(Type... args) {
[[nodiscard]] constexpr std::size_t HashCombine(Type... args) {
std::size_t seed = HashCombine();
HashCombineSeed(seed, args...);
return seed;