Skip to content

Commit

Permalink
aamp: Fix order of evaluation bug
Browse files Browse the repository at this point in the history
Argument order of evaluation is unspecified in C++17
  • Loading branch information
leoetlino committed Feb 12, 2020
1 parent 9e9a06b commit c4a9f94
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/include/oead/aamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c4a9f94

Please sign in to comment.