From 786dc6ef40338a8eaec36fb9af011a8669161e68 Mon Sep 17 00:00:00 2001 From: scribam Date: Sat, 16 Mar 2019 19:30:04 +0100 Subject: [PATCH] Use if constexpr in hash_struct function --- Utilities/hash.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Utilities/hash.h b/Utilities/hash.h index 58b2fd3c8c..6f42c30f50 100644 --- a/Utilities/hash.h +++ b/Utilities/hash.h @@ -28,20 +28,19 @@ namespace rpcs3 template static size_t hash_struct(const T& value) { - // TODO: use c++17 if constexpr static constexpr auto block_sz = sizeof(T); - if ((block_sz & 0x7) == 0) + if constexpr ((block_sz & 0x7) == 0) { return hash_struct_base(value); } - if ((block_sz & 0x3) == 0) + if constexpr ((block_sz & 0x3) == 0) { return hash_struct_base(value); } - if ((block_sz & 0x1) == 0) + if constexpr ((block_sz & 0x1) == 0) { return hash_struct_base(value); }