From d053fd9ed0bad8431cbf69896d38f03e6e7f7e84 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Mon, 26 Sep 2016 17:39:52 +0300 Subject: [PATCH] experiments/placer: fix hash bug sizeof(array) is not equal to size of array --- experiments/placer/layout.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/experiments/placer/layout.h b/experiments/placer/layout.h index 0d27f37a683..386d860617d 100644 --- a/experiments/placer/layout.h +++ b/experiments/placer/layout.h @@ -451,6 +451,7 @@ constexpr uint32_t crc32(const char * str) { return 0xFFFFFFFF; } -constexpr name_hash_t NameHash(const char* name) { - return crc32(name) ^ 0xFFFFFFFF; +template +constexpr name_hash_t NameHash(char const (&name)[len_plus_one]) { + return crc32(name) ^ 0xFFFFFFFF; }