summaryrefslogtreecommitdiffstats
path: root/core/variant/array.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit godotengine/godot@c6c464cf9ae56e8b68620af65125dd980d0e8122Spartan3222024-11-021-7/+7
|\
| * [Core] Improve error messages with `vformat`A Thousand Ships2024-10-301-7/+7
| |
* | Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
| |
* | Rebrand preambles to RedotDubhghlas McLaughlin2024-10-111-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* Merge pull request #95449 from SlashScreen/array_functionsRémi Verschelde2024-09-201-1/+64
|\ | | | | | | Add callable support for `find` and `rfind` `Array` methods
| * Add callable support for `find` and `rfind` `Array` methodsSlashscreen2024-09-131-1/+64
| |
* | Fix Unable to use ResourceLoader in C# after threaded load in GDScript #92798Hilderin2024-09-111-0/+10
|/
* Core: Improve vformat error reporting on sprintf failureRémi Verschelde2024-07-041-4/+4
| | | | And fix a few occurrences of formatting errors that led me to this.
* [Core] Add iteration support to `Array`A Thousand Ships2024-04-101-0/+16
|
* Replace error checks against `size` with `is_empty`A Thousand Ships2024-02-091-3/+3
|
* 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
|/
* Fix range error for `Array.slice`Ninni Pipping2023-07-071-4/+8
|
* Fix `Array.slice()` rounding for `abs(step) != 1`Ninni Pipping2023-03-141-1/+1
|
* GDScript: Fix can_reference check for typed arraysDmitrii Maganov2023-02-061-0/+3
|
* Merge pull request #71786 from raulsntos/dotnet/arrayRémi Verschelde2023-02-041-2/+2
|\ | | | | | | Sync C# Array with Core
| * Sync C# Array with CoreRaul Santos2023-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add `AddRange` method. - Add `Fill` method. - Add `Max` and `Min` methods. - Add `PickRandom` method. - Add `Reverse` method. - Add `RecursiveEqual` method. - Add `Sort` method. - Add `Slice` and `GetSliceRange` methods. - Add `IndexOf` overload that takes an index parameter. - Add `LastIndexOf` method. - Add `BinarySearch` method. - Add/update documentation.
* | Fix various typos with codespellRémi Verschelde2023-02-011-1/+1
| | | | | | | | Finally do the childs -> children rename too.
* | GDScript: Fix issues with typed arraysDmitrii Maganov2023-01-311-60/+77
|/
* 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-29/+67
|
* Remove `Array.find_last()`Micky2022-11-251-5/+0
|
* add ability to pick random value from arrayNonunknown2022-10-201-0/+6
|
* Fix Array.`slice()` and `filter()` forgetting Typed ArrayMicky2022-10-091-0/+2
|
* Remove Signal connect bindsJuan Linietsky2022-07-291-5/+5
| | | | | Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind(). Changed all uses of it to Callable.bind()
* Clean up Hash Functionsreduz2022-06-201-3/+3
| | | | | | | 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)
* Validate every source element separately Array::append_array()Pedro J. Estébanez2022-06-151-1/+3
|
* Add `any()` and `all()` methods to ArrayHugo Locurcio2022-05-251-0/+44
| | | | | These can be used as faster, more convenient shorthands to using `filter()` + `size()`.
* Implement read-only arraysGeorge Marques2022-05-171-1/+59
| | | | | | | Arrays can be set as read-only and thus cannot be modified. Assigning the array will create an editable copy. Similar to is already done to read-only dictionaries.
* Const Ref Callable for custom sort/searchmashumafi2022-03-271-23/+4
|
* 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
| |
* | `Array`: Relax `slice` bound checks to properly handle negative indicesRémi Verschelde2022-01-101-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The same is done for `Vector` (and thus `Packed*Array`). `begin` and `end` can now take any value and will be clamped to `[-size(), size()]`. Negative values are a shorthand for indexing the array from the last element upward. `end` is given a default `INT_MAX` value (which will be clamped to `size()`) so that the `end` parameter can be omitted to go from `begin` to the max size of the array. This makes `slice` works similarly to numpy's and JavaScript's.
* | Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* PackedByteArray, Array slice end exclusive, rename subarray to sliceNathan Franke2021-11-261-41/+16
|
* Rename `remove()` to `remove_at()` when removing by indexLightning_A2021-11-231-4/+4
|
* Modify Dictionary::operator== to do real key/value comparison with recursive ↵Emmanuel Leblond2021-10-301-6/+60
| | | | support (and add unittests)
* Implement bsearch for Vector and Packed*Arraymashumafi2021-09-301-30/+6
|
* Merge pull request #47406 from mashumafi/master-Array-insert-rcMax Hilbrunner2021-08-281-3/+3
|\ | | | | Array::insert consistent with Pool*Array::insert
| * Array::insert consistent with Pool*Array::insertmashumafi2021-03-271-3/+3
| |
* | Add an `Array.pop_at()` method to pop an element at an arbitrary indexHugo Locurcio2021-08-271-3/+28
| | | | | | | | Negative indices are supported to pop an element relative from the end.
* | Remove alloca from loop and use a single fixed size array declarationMarcel Admiraal2021-05-211-3/+3
| |
* | Add filter, map and reduce to ArrayTomasz Chabora2021-05-051-0/+73
| |
* | Add fill method to Arrays and PackedArraysMatheus Lima Cunha2021-04-211-0/+5
| |
* | Merge pull request #46991 from madmiraal/rename-invert-reverseRémi Verschelde2021-04-011-2/+2
|\ \ | | | | | | Rename Array.invert() to Array.reverse()
| * | Rename Array.invert() to Array.reverse()Marcel Admiraal2021-03-211-2/+2
| |/ | | | | | | | | Does the same internally for List and Vector<>, which includes all PackedArray types.
* | Add functions to retrieve type of a typed ArrayGeorge Marques2021-03-181-0/+16
| |