summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-09-01 17:38:39 +0200
committerGitHub <noreply@github.com>2022-09-01 17:38:39 +0200
commit41156a1e83b1110dcd08e08d2fc063dfd7cd6899 (patch)
treea2583b37bb55d340828914f17a5b8e8634b6d23c /doc/classes
parentd214956925c4d336c0a4f0d36e45cef30fdaab3c (diff)
parentcc424bcb18585f09148d12e28f8d4b9f54c8445d (diff)
Merge pull request #63968 from KoBeWi/finding_stuff_in_a_dictionary
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Dictionary.xml10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index 40b5e88fff..9dbeeb360c 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -4,7 +4,7 @@
Dictionary type.
</brief_description>
<description>
- Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are composed of pairs of keys (which must be unique) and values. Dictionaries will preserve the insertion order when adding elements, even though this may not be reflected when printing the dictionary. In other programming languages, this data structure is sometimes referred to as a hash map or associative array.
+ Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are composed of pairs of keys (which must be unique) and values. Dictionaries will preserve the insertion order when adding elements. In other programming languages, this data structure is sometimes referred to as a hash map or associative array.
You can define a dictionary by placing a comma-separated list of [code]key: value[/code] pairs in curly braces [code]{}[/code].
Erasing elements while iterating over them [b]is not supported[/b] and will result in undefined behavior.
[b]Note:[/b] Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use [method duplicate].
@@ -218,6 +218,14 @@
[b]Note:[/b] Don't erase elements while iterating over the dictionary. You can iterate over the [method keys] array instead.
</description>
</method>
+ <method name="find_key" qualifiers="const">
+ <return type="Variant" />
+ <param index="0" name="value" type="Variant" />
+ <description>
+ Returns the first key whose associated value is equal to [param value], or [code]null[/code] if no such value is found.
+ [b]Node:[/b] [code]null[/code] is also a valid key. I you have it in your [Dictionary], the [method find_key] method can give misleading results.
+ </description>
+ </method>
<method name="get" qualifiers="const">
<return type="Variant" />
<param index="0" name="key" type="Variant" />