diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-06-18 16:14:08 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-07-04 09:47:49 +0300 |
commit | 329923c6accccf7d39b0ec954f8e3b8384bbe1bc (patch) | |
tree | 0334329d786d5951eddcac07c07f8223728baef9 /core/templates | |
parent | 5b3b06187b79ff859bb7da81362d2234c6e64a50 (diff) |
Use custom key structs, instead of raw hashes for the Label3D and TextMesh, to avoid potential hash collisions.
Diffstat (limited to 'core/templates')
-rw-r--r-- | core/templates/lru.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/templates/lru.h b/core/templates/lru.h index 48ba318b12..55130cbeb0 100644 --- a/core/templates/lru.h +++ b/core/templates/lru.h @@ -35,7 +35,7 @@ #include "hash_map.h" #include "list.h" -template <class TKey, class TData> +template <class TKey, class TData, class Hasher = HashMapHasherDefault, class Comparator = HashMapComparatorDefault<TKey>> class LRUCache { private: struct Pair { @@ -52,7 +52,7 @@ private: typedef typename List<Pair>::Element *Element; List<Pair> _list; - HashMap<TKey, Element> _map; + HashMap<TKey, Element, Hasher, Comparator> _map; size_t capacity; public: |