mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
b696beea65
This fixes HashMap where a key or part of a key is a floating point number. To fix this the following has been done: * HashMap now takes an extra template argument Comparator. This class gets used to compare keys. The default Comperator now works correctly for common types and floating point numbets. * Variant implements ::hash_compare() now. This function implements nan-safe comparison for all types with components that contain floating point numbers. * Variant now has a VariantComparator which uses Variant::hash_compare() safely compare floating point components of variant's types. * The hash functions for floating point numbers will now normalize NaN values so that all floating point numbers that are NaN hash to the same value. C++ module writers that want to use HashMap internally in their modules can now also safeguard against this crash by defining their on Comperator class that safely compares their types. GDScript users, or writers of modules that don't use HashMap internally in their modules don't need to do anything. This fixes #7354 and fixes #6947. |
||
---|---|---|
.. | ||
cscript | ||
dds | ||
enet | ||
etc1 | ||
freetype | ||
gdscript | ||
gridmap | ||
jpg | ||
ogg | ||
openssl | ||
opus | ||
pbm | ||
pvr | ||
regex | ||
squish | ||
stb_vorbis | ||
theora | ||
visual_script | ||
vorbis | ||
webm | ||
webp | ||
register_module_types.h | ||
SCsub |