diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-04-01 13:32:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-01 13:32:22 +0200 |
commit | 4b6e9f315739c4400e3c2d27cd72028779bce1e5 (patch) | |
tree | 0625f98287fd20f0ffd6002b4c8ee4f81e068bb8 /core/variant | |
parent | 7db85fffb50ef98dbf175189fba17a4d7dc85f5d (diff) | |
parent | 755c70b871c659df2d7c3a003593f38775dd7b5d (diff) |
Merge pull request #46991 from madmiraal/rename-invert-reverse
Rename Array.invert() to Array.reverse()
Diffstat (limited to 'core/variant')
-rw-r--r-- | core/variant/array.cpp | 4 | ||||
-rw-r--r-- | core/variant/array.h | 2 | ||||
-rw-r--r-- | core/variant/variant_call.cpp | 20 |
3 files changed, 13 insertions, 13 deletions
diff --git a/core/variant/array.cpp b/core/variant/array.cpp index 707140ba1b..2ad728ec5e 100644 --- a/core/variant/array.cpp +++ b/core/variant/array.cpp @@ -446,8 +446,8 @@ int Array::bsearch_custom(const Variant &p_value, Callable p_callable, bool p_be return bisect(_p->array, p_value, p_before, less); } -void Array::invert() { - _p->array.invert(); +void Array::reverse() { + _p->array.reverse(); } void Array::push_front(const Variant &p_value) { diff --git a/core/variant/array.h b/core/variant/array.h index 8b67f7f085..6b58ed12cb 100644 --- a/core/variant/array.h +++ b/core/variant/array.h @@ -83,7 +83,7 @@ public: void shuffle(); int bsearch(const Variant &p_value, bool p_before = true); int bsearch_custom(const Variant &p_value, Callable p_callable, bool p_before = true); - void invert(); + void reverse(); int find(const Variant &p_value, int p_from = 0) const; int rfind(const Variant &p_value, int p_from = -1) const; diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 8c1d8066d6..8f2d252810 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1460,7 +1460,7 @@ static void _register_variant_builtin_methods() { bind_method(Array, shuffle, sarray(), varray()); bind_method(Array, bsearch, sarray("value", "before"), varray(true)); bind_method(Array, bsearch_custom, sarray("value", "func", "before"), varray(true)); - bind_method(Array, invert, sarray(), varray()); + bind_method(Array, reverse, sarray(), varray()); bind_method(Array, duplicate, sarray("deep"), varray(false)); bind_method(Array, slice, sarray("begin", "end", "step", "deep"), varray(1, false)); bind_method(Array, max, sarray(), varray()); @@ -1477,7 +1477,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedByteArray, insert, sarray("at_index", "value"), varray()); bind_method(PackedByteArray, resize, sarray("new_size"), varray()); bind_method(PackedByteArray, has, sarray("value"), varray()); - bind_method(PackedByteArray, invert, sarray(), varray()); + bind_method(PackedByteArray, reverse, sarray(), varray()); bind_method(PackedByteArray, subarray, sarray("from", "to"), varray()); bind_method(PackedByteArray, sort, sarray(), varray()); bind_method(PackedByteArray, duplicate, sarray(), varray()); @@ -1503,7 +1503,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedInt32Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedInt32Array, resize, sarray("new_size"), varray()); bind_method(PackedInt32Array, has, sarray("value"), varray()); - bind_method(PackedInt32Array, invert, sarray(), varray()); + bind_method(PackedInt32Array, reverse, sarray(), varray()); bind_method(PackedInt32Array, subarray, sarray("from", "to"), varray()); bind_method(PackedInt32Array, to_byte_array, sarray(), varray()); bind_method(PackedInt32Array, sort, sarray(), varray()); @@ -1521,7 +1521,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedInt64Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedInt64Array, resize, sarray("new_size"), varray()); bind_method(PackedInt64Array, has, sarray("value"), varray()); - bind_method(PackedInt64Array, invert, sarray(), varray()); + bind_method(PackedInt64Array, reverse, sarray(), varray()); bind_method(PackedInt64Array, subarray, sarray("from", "to"), varray()); bind_method(PackedInt64Array, to_byte_array, sarray(), varray()); bind_method(PackedInt64Array, sort, sarray(), varray()); @@ -1539,7 +1539,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedFloat32Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedFloat32Array, resize, sarray("new_size"), varray()); bind_method(PackedFloat32Array, has, sarray("value"), varray()); - bind_method(PackedFloat32Array, invert, sarray(), varray()); + bind_method(PackedFloat32Array, reverse, sarray(), varray()); bind_method(PackedFloat32Array, subarray, sarray("from", "to"), varray()); bind_method(PackedFloat32Array, to_byte_array, sarray(), varray()); bind_method(PackedFloat32Array, sort, sarray(), varray()); @@ -1557,7 +1557,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedFloat64Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedFloat64Array, resize, sarray("new_size"), varray()); bind_method(PackedFloat64Array, has, sarray("value"), varray()); - bind_method(PackedFloat64Array, invert, sarray(), varray()); + bind_method(PackedFloat64Array, reverse, sarray(), varray()); bind_method(PackedFloat64Array, subarray, sarray("from", "to"), varray()); bind_method(PackedFloat64Array, to_byte_array, sarray(), varray()); bind_method(PackedFloat64Array, sort, sarray(), varray()); @@ -1575,7 +1575,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedStringArray, insert, sarray("at_index", "value"), varray()); bind_method(PackedStringArray, resize, sarray("new_size"), varray()); bind_method(PackedStringArray, has, sarray("value"), varray()); - bind_method(PackedStringArray, invert, sarray(), varray()); + bind_method(PackedStringArray, reverse, sarray(), varray()); bind_method(PackedStringArray, subarray, sarray("from", "to"), varray()); bind_method(PackedStringArray, to_byte_array, sarray(), varray()); bind_method(PackedStringArray, sort, sarray(), varray()); @@ -1593,7 +1593,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedVector2Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedVector2Array, resize, sarray("new_size"), varray()); bind_method(PackedVector2Array, has, sarray("value"), varray()); - bind_method(PackedVector2Array, invert, sarray(), varray()); + bind_method(PackedVector2Array, reverse, sarray(), varray()); bind_method(PackedVector2Array, subarray, sarray("from", "to"), varray()); bind_method(PackedVector2Array, to_byte_array, sarray(), varray()); bind_method(PackedVector2Array, sort, sarray(), varray()); @@ -1611,7 +1611,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedVector3Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedVector3Array, resize, sarray("new_size"), varray()); bind_method(PackedVector3Array, has, sarray("value"), varray()); - bind_method(PackedVector3Array, invert, sarray(), varray()); + bind_method(PackedVector3Array, reverse, sarray(), varray()); bind_method(PackedVector3Array, subarray, sarray("from", "to"), varray()); bind_method(PackedVector3Array, to_byte_array, sarray(), varray()); bind_method(PackedVector3Array, sort, sarray(), varray()); @@ -1629,7 +1629,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedColorArray, insert, sarray("at_index", "value"), varray()); bind_method(PackedColorArray, resize, sarray("new_size"), varray()); bind_method(PackedColorArray, has, sarray("value"), varray()); - bind_method(PackedColorArray, invert, sarray(), varray()); + bind_method(PackedColorArray, reverse, sarray(), varray()); bind_method(PackedColorArray, subarray, sarray("from", "to"), varray()); bind_method(PackedColorArray, to_byte_array, sarray(), varray()); bind_method(PackedColorArray, sort, sarray(), varray()); |