From 17aff107e9a934e98a87dd67b24f8242166f1073 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 13 Jul 2021 06:53:25 -0700 Subject: [PATCH] Add [[nodiscard]] decorations to fml::HashCombine. (flutter/engine#27343) This makes it easier to catch errors when HashCombine was used instead of HashCombineSeed. --- engine/src/flutter/fml/hash_combine.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/fml/hash_combine.h b/engine/src/flutter/fml/hash_combine.h index e06f7d33f7c..fe85f05be91 100644 --- a/engine/src/flutter/fml/hash_combine.h +++ b/engine/src/flutter/fml/hash_combine.h @@ -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 -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;