aboutsummaryrefslogtreecommitdiff
path: root/core/hashfuncs.h
diff options
context:
space:
mode:
authorRăzvan Cosmin Rădulescu2016-10-04 10:57:16 +0200
committerRăzvan Cosmin Rădulescu2016-10-12 21:24:07 +0200
commit9ad0850301045e0d7fd243340e807fb2c9f736de (patch)
tree62de0751771d5a32675643d8976152afa6e41f97 /core/hashfuncs.h
parent12843167cacf3bacca32c29b7ea8b4426392bad0 (diff)
downloadgodot-9ad0850301045e0d7fd243340e807fb2c9f736de.tar.gz
godot-9ad0850301045e0d7fd243340e807fb2c9f736de.tar.zst
godot-9ad0850301045e0d7fd243340e807fb2c9f736de.zip
Diffstat (limited to 'core/hashfuncs.h')
-rw-r--r--core/hashfuncs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/hashfuncs.h b/core/hashfuncs.h
index a917ee5ed..6c029a345 100644
--- a/core/hashfuncs.h
+++ b/core/hashfuncs.h
@@ -74,7 +74,10 @@ static inline uint32_t hash_djb2_one_float(float p_in,uint32_t p_prev=5381) {
float f;
uint32_t i;
} u;
- u.f=p_in;
+
+ // handle -0 case
+ if (p_in==0.0f) u.f=0.0f;
+ else u.f=p_in;
return ((p_prev<<5)+p_prev)+u.i;
}