Skip to content

Commit a68d615

Browse files
authored
Update data_preferences.rst
Change the `OrderedHashMap` to `HashMap` to remove potential confusion and keep docs in sync with the actual implementation
1 parent 2ec67eb commit a68d615

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorials/best_practices/data_preferences.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ Contiguous memory stores imply the following operation performance:
105105
though. Done by re-sorting the Array after every edit and writing an
106106
ordered-aware search algorithm.
107107

108-
Godot implements Dictionary as an ``OrderedHashMap<Variant, Variant>``. The engine
108+
Godot implements Dictionary as an ``HashMap<Variant, Variant, VariantHasher, StringLikeVariantComparator>;``. The engine
109109
stores a small array (initialized to 2^3 or 8 records) of key-value pairs. When
110110
one attempts to access a value, they provide it a key. It then *hashes* the
111111
key, i.e. converts it into a number. The "hash" is used to calculate the index
112-
into the array. As an array, the OHM then has a quick lookup within the "table"
112+
into the array. As an array, the HM then has a quick lookup within the "table"
113113
of keys mapped to values. When the HashMap becomes too full, it increases to
114114
the next power of 2 (so, 16 records, then 32, etc.) and rebuilds the structure.
115115

0 commit comments

Comments
 (0)