From c4a9f9407d4f002e9e2561a4ea525db6146035a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Wed, 12 Feb 2020 21:23:48 +0100 Subject: [PATCH] aamp: Fix order of evaluation bug Argument order of evaluation is unspecified in C++17 --- src/include/oead/aamp.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/include/oead/aamp.h b/src/include/oead/aamp.h index a222d8d..acdb5f7 100644 --- a/src/include/oead/aamp.h +++ b/src/include/oead/aamp.h @@ -50,7 +50,10 @@ struct NameTable { /// Add a known string to the name table. /// \return a view to the added string. - std::string_view AddName(std::string name) { return AddName(util::crc32(name), std::move(name)); } + std::string_view AddName(std::string name) { + const u32 hash = util::crc32(name); + return AddName(hash, std::move(name)); + } /// Add a known string to the name table. This should be used if the string's hash /// has already been computed in order to avoid recomputing it. /// \return a view to the added string.