summaryrefslogtreecommitdiffstats
path: root/core/variant/dictionary.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Core: Fix `operator[]` for typed dictionariesThaddeus Crews2024-09-121-10/+49
|
* Fix Dictionary.merge() type validationkobewi2024-09-111-1/+1
|
* Implement typed dictionariesThaddeus Crews2024-09-041-11/+265
|
* StringName Dictionary keysrune-scape2024-08-291-15/+2
| | | | | also added 'is_string()' method to Variant and refactored many String type comparisons to use it instead
* Allow returning Dictionary after mergingkobewi2024-03-061-0/+7
|
* Remove unnecessary `this->` expressionsA Thousand Ships2024-01-291-1/+1
|
* Add a `get_or_add` method to DictionaryAaron Franke2023-12-061-0/+9
|
* Merge pull request #74588 from puchik/float-variant-nan-inequalityRémi Verschelde2023-09-271-1/+1
|\ | | | | | | Support numeric/binary hash comparison for floats derived from Variants (as well as existing semantic comparison)
| * Support both semantic (by default) and numeric Variant hash comparisonArman Elgudzhyan2023-08-311-1/+1
| | | | | | | | Hash comparison for Variant continues to perform semantic/logical comparison with NaN's considered equal by default (to prevent #16114, #7354, #6947, #8081), but now optionally allows for numeric comparison that does not consider NaN's equal to support proper value comparison (for #72222)
* | [Core] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicableA Thousand Ships2023-09-111-1/+1
|/
* Added the missing second case for string keysMario Liebisch2023-03-111-2/+4
|
* Fixed read-only dictionaries adding missing keysMario Liebisch2023-03-101-1/+6
| | | | | | | When querying a non-existing key on a read-only dictionary, the key was still added (albeit never set). This fixes #74726.
* GDScript: Fix test for read-only state of constantsDmitrii Maganov2023-01-271-8/+2
|
* GDScript: Begin making constants deep, not shallow or flatDmitrii Maganov2023-01-081-10/+0
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Unify String and StringNamerune-scape2022-12-051-46/+10
|
* Add Dictionary.find_key()kobewi2022-08-161-0/+9
|
* Clean up Hash Functionsreduz2022-06-201-4/+4
| | | | | | | Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934 * Clean up usage of murmur3 * Fixed usages of binary murmur3 on floats (this is invalid) * Changed DJB2 to use xor (which seems to be better)
* Add Dictionary.merge()kobewi2022-05-311-0/+8
|
* Implement read-only dictionaries.reduz2022-05-161-5/+55
| | | | | | | * Add ability to set them read only. * If read-only, it can't be modified. This is added in order to optionally make const dictionaries (and eventually arrays) properly read-only in GDScript.
* Add a new HashMap implementationreduz2022-05-121-39/+46
| | | | | | | | | | | | | | | | | Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
* Merge pull request #56337 from cdemirer/fix-array-dictionary-idRémi Verschelde2022-01-231-1/+1
|\
| * Fix Array and Dictionary id() and dictionary test bugcdemirer2021-12-301-1/+1
| |
* | Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Modify Dictionary::operator== to do real key/value comparison with recursive ↵Emmanuel Leblond2021-10-301-6/+56
| | | | support (and add unittests)
* Force String as Dictionary key instead of StringNamereduz2021-07-011-7/+52
| | | | | | | * Lua table syntax uses named indexing: `{ mykey = myvalue }` * Python style syntax uses string indexing: `{ "mykey" : myvalue }` * Both are incompatible since a StringName key wont fetch a String key, hence confusing. * This PR proposes always using String for indexing at a very minimal performance cost. Always indexing with StringNames will be faster, but they are considerably more expensive to create.
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-4/+4
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-0/+273
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code