Commit Graph

14 Commits

Author SHA1 Message Date
Ninni Pipping b43f847808 Fix `Array.slice()` rounding for `abs(step) != 1`
(cherry picked from commit 10f385fb79)
2023-03-27 17:31:05 +02:00
Dmitrii Maganov c5f7a89b0f Core: Identity compare objects by id, not by pointers 2023-02-24 23:33:29 +02:00
Adam Scott 37248d7c87 Add `@GlobalScope` `is_same(a, b)` and `Variant::identity_compare()` 2023-01-25 10:46:21 -05:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
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".
2023-01-05 13:25:55 +01:00
rune-scape e79be6ce07 Unify String and StringName 2022-12-05 21:46:47 -05:00
kobewi cc424bcb18 Add Dictionary.find_key() 2022-08-16 13:48:59 +02:00
Yuri Sizov 1362bc22bd Add tests for empty/unnamed arguments to ClassDB, Variant, GDScript 2022-08-08 16:36:01 +03:00
Rémi Verschelde 668d6a1c5c
Merge pull request #56337 from cdemirer/fix-array-dictionary-id 2022-01-23 00:46:53 +01:00
Rémi Verschelde c6cefb1b79
`Array`: Relax `slice` bound checks to properly handle negative indices
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.
2022-01-10 22:42:03 +01:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
cdemirer e2ed9d13eb Fix Array and Dictionary id() and dictionary test bug 2021-12-30 13:14:09 +08:00
Nathan Franke dd30253cdc
PackedByteArray, Array slice end exclusive, rename subarray to slice 2021-11-26 22:13:12 -06:00
Lightning_A e078f970db Rename `remove()` to `remove_at()` when removing by index 2021-11-23 18:58:57 -07:00
Aaron Franke 99a282f631
Move and organize tests into subfolders 2021-11-07 00:43:31 -06:00