From a68d61590ffe4351cc45046e783102154f05b1b9 Mon Sep 17 00:00:00 2001 From: Salty Grndpa <53660556+tredstart@users.noreply.github.com> Date: Thu, 27 Mar 2025 13:05:06 +0100 Subject: [PATCH 1/2] Update data_preferences.rst Change the `OrderedHashMap` to `HashMap` to remove potential confusion and keep docs in sync with the actual implementation --- tutorials/best_practices/data_preferences.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/best_practices/data_preferences.rst b/tutorials/best_practices/data_preferences.rst index 01b289e26..700cc3503 100644 --- a/tutorials/best_practices/data_preferences.rst +++ b/tutorials/best_practices/data_preferences.rst @@ -105,11 +105,11 @@ Contiguous memory stores imply the following operation performance: though. Done by re-sorting the Array after every edit and writing an ordered-aware search algorithm. -Godot implements Dictionary as an ``OrderedHashMap``. The engine +Godot implements Dictionary as an ``HashMap;``. The engine stores a small array (initialized to 2^3 or 8 records) of key-value pairs. When one attempts to access a value, they provide it a key. It then *hashes* the key, i.e. converts it into a number. The "hash" is used to calculate the index -into the array. As an array, the OHM then has a quick lookup within the "table" +into the array. As an array, the HM then has a quick lookup within the "table" of keys mapped to values. When the HashMap becomes too full, it increases to the next power of 2 (so, 16 records, then 32, etc.) and rebuilds the structure. From 6f515e993ba54587a3adae583181d08c2e97de98 Mon Sep 17 00:00:00 2001 From: Salty Grndpa <53660556+tredstart@users.noreply.github.com> Date: Thu, 27 Mar 2025 13:48:12 +0100 Subject: [PATCH 2/2] Update tutorials/best_practices/data_preferences.rst remove unnecessary ';' Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> --- tutorials/best_practices/data_preferences.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/best_practices/data_preferences.rst b/tutorials/best_practices/data_preferences.rst index 700cc3503..1bfe478b6 100644 --- a/tutorials/best_practices/data_preferences.rst +++ b/tutorials/best_practices/data_preferences.rst @@ -105,7 +105,7 @@ Contiguous memory stores imply the following operation performance: though. Done by re-sorting the Array after every edit and writing an ordered-aware search algorithm. -Godot implements Dictionary as an ``HashMap;``. The engine +Godot implements Dictionary as an ``HashMap``. The engine stores a small array (initialized to 2^3 or 8 records) of key-value pairs. When one attempts to access a value, they provide it a key. It then *hashes* the key, i.e. converts it into a number. The "hash" is used to calculate the index