changeset 1801:af3f6c411a8e

*sigh*
author Chris Cannam
date Thu, 10 Oct 2019 09:34:12 +0100
parents 705ea8699d49
children c48548a85622
files base/Event.h
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/base/Event.h	Thu Oct 10 09:18:37 2019 +0100
+++ b/base/Event.h	Thu Oct 10 09:34:12 2019 +0100
@@ -28,9 +28,12 @@
 
 #if (QT_VERSION < QT_VERSION_CHECK(5, 3, 0))
 uint qHash(float key, uint seed) {
-    return key != 0.0f ?
-        qHash(reinterpret_cast<const uchar *>(&key), sizeof(key), seed) :
-        seed;
+    uint h = seed;
+    const uchar *p = reinterpret_cast<const uchar *>(&key);
+    for (size_t i = 0; i < sizeof(key); ++i) {
+        h = 31 * h + p[i];
+    }
+    return h;
 }
 #endif