Fix miss implementation of hash salt 47/303847/1
authorEunki Hong <eunkiki.hong@samsung.com>
Sun, 7 Jan 2024 00:50:10 +0000 (09:50 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Sun, 7 Jan 2024 00:50:10 +0000 (09:50 +0900)
sizeof(T) return as byte. But previous hash function use it like bit.

Change-Id: Ia4378a0bb40aca4928a127be4e2adc6db1b84e7f
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
dali/internal/graphics/gles-impl/gles-context.cpp

index dbdb318..e92b8bd 100644 (file)
@@ -63,10 +63,10 @@ struct Context::Impl
       // Make unordered hash value by location.
       // Note : This hash function varified for locations only under < 20.
       std::size_t salt = attr.location + 1;
-      hash += salt << (sizeof(std::size_t) * 3 / 4);
+      hash += salt << (sizeof(std::size_t) * 6);
       salt *= salt;
       salt ^= attr.location;
-      hash += salt << (sizeof(std::size_t) / 2);
+      hash += salt << (sizeof(std::size_t) * 4);
       salt *= salt;
       hash += salt;
     }