summaryrefslogtreecommitdiffstats
path: root/core/dictionary.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-10/+20
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-26/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Replace NULL with nullptrlupoDharkael2020-04-021-7/+7
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Optimized Dictionary hash() and duplicate() methodsPouleyKetchoupp2019-10-101-14/+9
|
* Don't crash on printing nested typesHein-Pieter van Braam-Stewart2019-04-201-0/+4
| | | | | | | | | | When adding an Array or Dictionary to itself operator String() got in an infinite loop. This commit adds a stack to operator String() (Through the use of a new 'stringify method'). This stack keeps track of all unique Arrays and Dictionaries it has seen. When a duplicate is found only a static string is printed '[...]' or '{...}'. This mirror Python's behavior in a similar case.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Added Python-like .get() method to Dictionary in GDScript #20488m2018-11-191-0/+9
| | | | Added .get() method to Dictionary class in GDScript to return the value if the key exists, or return Null if the key does not exist.
* Remove redundant "== false" codeAaron Franke2018-10-061-0/+5
| | | | | | Some of this code has been re-organized. f
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-3/+3
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Dictionary: remove erase_checked(key), make erase(key) return boolIgnacio Etcheverry2018-08-141-6/+1
|
* Add Dictionary::erase_checked(key) methodIgnacio Etcheverry2018-07-181-0/+5
| | | | | Same as erase, but it returns a boolean value indicating whether the pair was erased or not. This method should be removed during the next compatibility breakage, and 'Dictionary::erase(key)' should be changed to return a boolean.
* Dictionary editing support in inspectorJuan Linietsky2018-05-191-0/+26
|
* Duplicate Arrays and Dictionaries when instancing scene in editorBojidar Marinov2018-03-131-2/+2
| | | | | | Also, add deep (=false) parameter to Array.duplicate and Dictionary.duplicate Fixes #13971
* Use the appropriate Variant hash and compare functions for DictionariesHein-Pieter van Braam2018-01-271-13/+8
| | | | | | | | | | | | | | | Dictionaires did not use the VariantHasher and VariantComparator making them unsafe for use with NaN values as keys. This PR uses the appropriate Variant implementations for these functions. var d = {} d[Vector2(NAN, NAN)] = 0 d[Vector2(NAN, NAN)] = 0 print(d.size()) will now output '1' and not '2' This fixes #16031
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Dictionary::copy -> ::duplicateWill Nations2017-12-171-1/+1
|
* fix Dictionary iterationkarroffel2017-12-051-1/+3
|
* fix dictionary constant access crashKarroffel2017-11-091-1/+1
|
* make Dictionary use OrderedHashMapKarroffel2017-11-051-68/+35
|
* Dead code tells no talesRémi Verschelde2017-08-271-12/+0
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Requesting for dictionary keys also respects insertion order, closes #9161Juan Linietsky2017-07-231-0/+21
|
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-79/+53
| | | | | | | | | | | | | | | | | | | | | | | | I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
* Style: Cleanups, added headers, renamed filesRémi Verschelde2017-01-161-0/+1
| | | | | | | | | Made sure files in core/ and tools/ have a proper Godot license header when written by us. Also renamed aabb.{cpp,h} and object_type_db.{cpp,h} to rect3.{cpp,h} and class_db.{cpp,h} respectively. Also added a proper header to core/io/base64.{c,h} after clarifying the licensing with the original author (public domain).
* Both Array and Dictionary are always in shared mode (removed copy on write).Juan Linietsky2017-01-111-27/+5
|
* Moved JSON functions to built-in to_json, parse_json, validate_jsonJuan Linietsky2017-01-081-22/+0
|
* Dictionary keys are now sorted by insertion orderJuan Linietsky2017-01-081-13/+75
|
* Welcome in 2017, dear changelog reader!Rémi Verschelde2017-01-011-1/+1
| | | | | | | | That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games!
* WIP visual scripting, not working yet but you can check out stuffJuan Linietsky2016-08-021-0/+14
|
* Added Dictionary.values()J08nY2016-06-051-2/+12
|
* dictionary has_allAlexander Holland2016-04-041-0/+10
|
* Update copyright to 2016 in headersGeorge Marques2016-01-011-1/+1
|
* -hash dictionaries properly instead of using pointer, fixes #2880Juan Linietsky2015-12-131-1/+14
|
* Updated copyright year in all headersJuan Linietsky2015-04-181-1/+1
|
* Fix for bug 1088Muresan Vlad aka Mury2015-01-021-0/+2
|
* GODOT IS OPEN SOURCEJuan Linietsky2014-02-091-0/+229