From e078f970db0e72bcc665d714416e6fc74e8434a6 Mon Sep 17 00:00:00 2001 From: Lightning_A Date: Sat, 3 Jul 2021 16:17:03 -0600 Subject: [PATCH] Rename `remove()` to `remove_at()` when removing by index --- core/input/input.cpp | 2 +- core/math/a_star.cpp | 4 +- core/math/bvh.h | 2 +- core/math/bvh_pair.inc | 2 +- core/math/convex_hull.cpp | 2 +- core/math/delaunay_2d.h | 4 +- core/math/expression.cpp | 6 +-- core/object/undo_redo.cpp | 2 +- core/string/node_path.cpp | 6 +-- core/string/ustring.cpp | 8 ++-- core/string/ustring.h | 2 +- core/templates/bin_sorted_array.h | 2 +- core/templates/cowdata.h | 2 +- core/templates/local_vector.h | 6 +-- core/templates/vector.h | 4 +- core/templates/vmap.h | 2 +- core/templates/vset.h | 2 +- core/variant/array.cpp | 8 ++-- core/variant/array.h | 2 +- core/variant/variant_call.cpp | 20 ++++---- core/variant/variant_setget.cpp | 6 +-- doc/classes/Array.xml | 4 +- doc/classes/PackedByteArray.xml | 2 +- doc/classes/PackedColorArray.xml | 2 +- doc/classes/PackedFloat32Array.xml | 2 +- doc/classes/PackedFloat64Array.xml | 2 +- doc/classes/PackedInt32Array.xml | 2 +- doc/classes/PackedInt64Array.xml | 2 +- doc/classes/PackedStringArray.xml | 2 +- doc/classes/PackedVector2Array.xml | 2 +- doc/classes/PackedVector3Array.xml | 2 +- editor/action_map_editor.cpp | 2 +- editor/connections_dialog.cpp | 4 +- editor/create_dialog.cpp | 2 +- editor/editor_data.cpp | 8 ++-- editor/editor_export.cpp | 2 +- editor/editor_file_dialog.cpp | 4 +- editor/editor_file_system.cpp | 4 +- editor/editor_inspector.cpp | 4 +- editor/editor_node.cpp | 8 ++-- editor/editor_properties_array_dict.cpp | 2 +- editor/editor_run.cpp | 2 +- editor/filesystem_dock.cpp | 10 ++-- editor/import/collada.cpp | 8 ++-- editor/localization_editor.cpp | 8 ++-- editor/plugins/abstract_polygon_2d_editor.cpp | 4 +- .../animation_blend_tree_editor_plugin.cpp | 2 +- editor/plugins/canvas_item_editor_plugin.cpp | 6 +-- .../collision_polygon_3d_editor_plugin.cpp | 2 +- editor/plugins/node_3d_editor_plugin.cpp | 2 +- editor/plugins/polygon_2d_editor_plugin.cpp | 10 ++-- editor/plugins/script_editor_plugin.cpp | 4 +- editor/plugins/tiles/tile_data_editors.cpp | 6 +-- .../plugins/visual_shader_editor_plugin.cpp | 2 +- editor/project_manager.cpp | 4 +- editor/settings_config_dialog.cpp | 4 +- modules/bullet/area_bullet.cpp | 4 +- modules/bullet/collision_object_bullet.cpp | 4 +- modules/bullet/soft_body_bullet.cpp | 2 +- modules/csg/csg.cpp | 16 +++---- modules/gdscript/gdscript.cpp | 4 +- modules/gdscript/gdscript_parser.cpp | 4 +- .../gdscript_language_protocol.cpp | 2 +- modules/mono/glue/collections_glue.cpp | 4 +- .../navigation/godot_navigation_server.cpp | 8 ++-- modules/text_server_adv/text_server_adv.cpp | 2 +- modules/text_server_fb/text_server_fb.cpp | 2 +- modules/upnp/upnp.cpp | 2 +- modules/visual_script/visual_script.cpp | 2 +- .../visual_script_expression.cpp | 6 +-- modules/visual_script/visual_script_nodes.cpp | 6 +-- platform/android/android_input_handler.cpp | 2 +- platform/android/export/export_plugin.cpp | 2 +- platform/linuxbsd/display_server_x11.cpp | 2 +- platform/linuxbsd/joypad_linux.cpp | 2 +- platform/osx/gl_manager_osx.mm | 2 +- platform/osx/joypad_osx.cpp | 2 +- platform/uwp/export/export_plugin.cpp | 2 +- platform/windows/gl_manager_windows.cpp | 4 +- scene/2d/audio_stream_player_2d.cpp | 2 +- scene/2d/collision_object_2d.cpp | 2 +- scene/2d/line_2d.cpp | 2 +- scene/2d/navigation_region_2d.cpp | 2 +- scene/2d/polygon_2d.cpp | 2 +- scene/2d/skeleton_2d.cpp | 2 +- scene/2d/tile_map.cpp | 4 +- scene/3d/audio_stream_player_3d.cpp | 2 +- scene/3d/collision_object_3d.cpp | 2 +- scene/3d/node_3d.cpp | 2 +- scene/3d/skeleton_3d.cpp | 2 +- scene/3d/soft_dynamic_body_3d.cpp | 2 +- scene/animation/animation_blend_space_2d.cpp | 4 +- .../animation_node_state_machine.cpp | 8 ++-- scene/animation/animation_tree.cpp | 2 +- scene/audio/audio_stream_player.cpp | 2 +- scene/gui/code_edit.cpp | 6 +-- scene/gui/gradient_edit.cpp | 4 +- scene/gui/item_list.cpp | 4 +- scene/gui/popup_menu.cpp | 2 +- scene/gui/rich_text_label.cpp | 6 +-- scene/gui/tab_bar.cpp | 4 +- scene/gui/text_edit.cpp | 14 +++--- scene/gui/text_edit.h | 2 +- scene/gui/tree.cpp | 2 +- scene/gui/tree.h | 2 +- scene/main/node.cpp | 4 +- scene/main/viewport.cpp | 6 +-- scene/resources/animation.cpp | 48 +++++++++---------- scene/resources/curve.cpp | 8 ++-- scene/resources/font.cpp | 6 +-- scene/resources/gradient.cpp | 2 +- scene/resources/packed_scene.cpp | 2 +- .../skeleton_modification_stack_2d.cpp | 2 +- .../skeleton_modification_stack_3d.cpp | 4 +- scene/resources/sprite_frames.cpp | 2 +- scene/resources/syntax_highlighter.cpp | 2 +- scene/resources/tile_set.cpp | 44 ++++++++--------- scene/resources/visual_shader.cpp | 2 +- servers/audio_server.cpp | 6 +-- servers/camera_server.cpp | 2 +- servers/physics_2d/godot_body_2d.h | 2 +- .../physics_2d/godot_collision_object_2d.cpp | 2 +- servers/physics_3d/godot_body_3d.h | 2 +- .../physics_3d/godot_collision_object_3d.cpp | 2 +- servers/physics_3d/godot_soft_body_3d.cpp | 2 +- servers/physics_3d/godot_soft_body_3d.h | 2 +- servers/rendering/renderer_canvas_cull.h | 2 +- servers/rendering/renderer_scene_cull.cpp | 2 +- servers/rendering/shader_language.cpp | 8 ++-- servers/text_server.cpp | 6 +-- servers/xr_server.cpp | 4 +- tests/core/templates/test_local_vector.h | 24 +++++----- tests/core/templates/test_vector.h | 34 ++++++------- tests/core/variant/test_array.h | 10 ++-- 134 files changed, 323 insertions(+), 323 deletions(-) diff --git a/core/input/input.cpp b/core/input/input.cpp index d0144ca47f4..342ab3b704f 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -1351,7 +1351,7 @@ void Input::add_joy_mapping(String p_mapping, bool p_update_existing) { void Input::remove_joy_mapping(String p_guid) { for (int i = map_db.size() - 1; i >= 0; i--) { if (p_guid == map_db[i].uid) { - map_db.remove(i); + map_db.remove_at(i); } } for (KeyValue &E : joy_names) { diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 1079da75ef1..8a44646ef95 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -344,7 +344,7 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { } sorter.pop_heap(0, open_list.size(), open_list.ptrw()); // Remove the current point from the open list - open_list.remove(open_list.size() - 1); + open_list.remove_at(open_list.size() - 1); p->closed_pass = pass; // Mark the point as closed for (OAHashMap::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) { @@ -812,7 +812,7 @@ bool AStar2D::_solve(AStar::Point *begin_point, AStar::Point *end_point) { } sorter.pop_heap(0, open_list.size(), open_list.ptrw()); // Remove the current point from the open list - open_list.remove(open_list.size() - 1); + open_list.remove_at(open_list.size() - 1); p->closed_pass = astar.pass; // Mark the point as closed for (OAHashMap::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) { diff --git a/core/math/bvh.h b/core/math/bvh.h index 65b8b102a3a..c1eff021786 100644 --- a/core/math/bvh.h +++ b/core/math/bvh.h @@ -654,7 +654,7 @@ private: // remove from changed items (not very efficient yet) for (int n = 0; n < (int)changed_items.size(); n++) { if (changed_items[n] == p_handle) { - changed_items.remove_unordered(n); + changed_items.remove_at_unordered(n); // because we are using an unordered remove, // the last changed item will now be at spot 'n', diff --git a/core/math/bvh_pair.inc b/core/math/bvh_pair.inc index 839db59a3aa..a12acec2b61 100644 --- a/core/math/bvh_pair.inc +++ b/core/math/bvh_pair.inc @@ -51,7 +51,7 @@ struct ItemPairs { for (int n = 0; n < num_pairs; n++) { if (extended_pairs[n].handle == h) { userdata = extended_pairs[n].userdata; - extended_pairs.remove_unordered(n); + extended_pairs.remove_at_unordered(n); num_pairs--; break; } diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp index f6560f1beaf..2956e0cf09c 100644 --- a/core/math/convex_hull.cpp +++ b/core/math/convex_hull.cpp @@ -1688,7 +1688,7 @@ real_t ConvexHullInternal::shrink(real_t p_amount, real_t p_clamp_amount) { while (stack.size() > 0) { Vertex *v = stack[stack.size() - 1]; - stack.remove(stack.size() - 1); + stack.remove_at(stack.size() - 1); Edge *e = v->edges; if (e) { do { diff --git a/core/math/delaunay_2d.h b/core/math/delaunay_2d.h index 2f80cb5634a..779ac96b79a 100644 --- a/core/math/delaunay_2d.h +++ b/core/math/delaunay_2d.h @@ -123,7 +123,7 @@ public: for (int j = 0; j < triangles.size(); j++) { if (triangles[j].bad) { - triangles.remove(j); + triangles.remove_at(j); j--; } } @@ -154,7 +154,7 @@ public: } } if (invalid) { - triangles.remove(i); + triangles.remove_at(i); i--; } } diff --git a/core/math/expression.cpp b/core/math/expression.cpp index 05f2c8dac90..f366fd04998 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -1087,7 +1087,7 @@ Expression::ENode *Expression::_parse_expression() { op->nodes[1] = nullptr; expression.write[i].is_op = false; expression.write[i].node = op; - expression.remove(i + 1); + expression.remove_at(i + 1); } } else { @@ -1119,8 +1119,8 @@ Expression::ENode *Expression::_parse_expression() { //replace all 3 nodes by this operator and make it an expression expression.write[next_op - 1].node = op; - expression.remove(next_op); - expression.remove(next_op); + expression.remove_at(next_op); + expression.remove_at(next_op); } } diff --git a/core/object/undo_redo.cpp b/core/object/undo_redo.cpp index 07006e79687..3459506860e 100644 --- a/core/object/undo_redo.cpp +++ b/core/object/undo_redo.cpp @@ -282,7 +282,7 @@ void UndoRedo::_pop_history_tail() { } } - actions.remove(0); + actions.remove_at(0); if (current_action >= 0) { current_action--; } diff --git a/core/string/node_path.cpp b/core/string/node_path.cpp index 5fae13779e9..7ab85ac9d04 100644 --- a/core/string/node_path.cpp +++ b/core/string/node_path.cpp @@ -293,12 +293,12 @@ void NodePath::simplify() { break; } if (data->path[i].operator String() == ".") { - data->path.remove(i); + data->path.remove_at(i); i--; } else if (i > 0 && data->path[i].operator String() == ".." && data->path[i - 1].operator String() != "." && data->path[i - 1].operator String() != "..") { //remove both - data->path.remove(i - 1); - data->path.remove(i - 1); + data->path.remove_at(i - 1); + data->path.remove_at(i - 1); i -= 2; if (data->path.size() == 0) { data->path.push_back("."); diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 70236231a25..320aae2ba4a 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -3670,15 +3670,15 @@ String String::simplify_path() const { for (int i = 0; i < dirs.size(); i++) { String d = dirs[i]; if (d == ".") { - dirs.remove(i); + dirs.remove_at(i); i--; } else if (d == "..") { if (i == 0) { - dirs.remove(i); + dirs.remove_at(i); i--; } else { - dirs.remove(i); - dirs.remove(i - 1); + dirs.remove_at(i); + dirs.remove_at(i - 1); i -= 2; } } diff --git a/core/string/ustring.h b/core/string/ustring.h index 1d80ccf58d6..f25c36f66ce 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -209,7 +209,7 @@ public: _FORCE_INLINE_ char32_t *ptrw() { return _cowdata.ptrw(); } _FORCE_INLINE_ const char32_t *ptr() const { return _cowdata.ptr(); } - void remove(int p_index) { _cowdata.remove(p_index); } + void remove_at(int p_index) { _cowdata.remove_at(p_index); } _FORCE_INLINE_ void clear() { resize(0); } diff --git a/core/templates/bin_sorted_array.h b/core/templates/bin_sorted_array.h index be9d0b54750..8db3e7aeb85 100644 --- a/core/templates/bin_sorted_array.h +++ b/core/templates/bin_sorted_array.h @@ -112,7 +112,7 @@ public: return current_idx; } - void remove(uint64_t p_idx) { + void remove_at(uint64_t p_idx) { ERR_FAIL_COND(p_idx >= array.size()); uint64_t new_idx = move(p_idx, 0); uint64_t swap_idx = array.size() - 1; diff --git a/core/templates/cowdata.h b/core/templates/cowdata.h index 9b8c0eb528a..e79ca037db4 100644 --- a/core/templates/cowdata.h +++ b/core/templates/cowdata.h @@ -167,7 +167,7 @@ public: Error resize(int p_size); - _FORCE_INLINE_ void remove(int p_index) { + _FORCE_INLINE_ void remove_at(int p_index) { ERR_FAIL_INDEX(p_index, size()); T *p = ptrw(); int len = size(); diff --git a/core/templates/local_vector.h b/core/templates/local_vector.h index 5704b8f2303..3854e1e94c2 100644 --- a/core/templates/local_vector.h +++ b/core/templates/local_vector.h @@ -70,7 +70,7 @@ public: } } - void remove(U p_index) { + void remove_at(U p_index) { ERR_FAIL_UNSIGNED_INDEX(p_index, count); count--; for (U i = p_index; i < count; i++) { @@ -83,7 +83,7 @@ public: /// Removes the item copying the last value into the position of the one to /// remove. It's generally faster than `remove`. - void remove_unordered(U p_index) { + void remove_at_unordered(U p_index) { ERR_FAIL_INDEX(p_index, count); count--; if (count > p_index) { @@ -97,7 +97,7 @@ public: void erase(const T &p_val) { int64_t idx = find(p_val); if (idx >= 0) { - remove(idx); + remove_at(idx); } } diff --git a/core/templates/vector.h b/core/templates/vector.h index 98982c80d33..a955d49101e 100644 --- a/core/templates/vector.h +++ b/core/templates/vector.h @@ -68,11 +68,11 @@ public: _FORCE_INLINE_ bool append(const T &p_elem) { return push_back(p_elem); } //alias void fill(T p_elem); - void remove(int p_index) { _cowdata.remove(p_index); } + void remove_at(int p_index) { _cowdata.remove_at(p_index); } void erase(const T &p_val) { int idx = find(p_val); if (idx >= 0) { - remove(idx); + remove_at(idx); } } void reverse(); diff --git a/core/templates/vmap.h b/core/templates/vmap.h index 520e0b3720c..2aa22f97cf4 100644 --- a/core/templates/vmap.h +++ b/core/templates/vmap.h @@ -134,7 +134,7 @@ public: if (pos < 0) { return; } - _cowdata.remove(pos); + _cowdata.remove_at(pos); } int find(const T &p_val) const { diff --git a/core/templates/vset.h b/core/templates/vset.h index 6665651d423..94e7a170619 100644 --- a/core/templates/vset.h +++ b/core/templates/vset.h @@ -119,7 +119,7 @@ public: if (pos < 0) { return; } - _data.remove(pos); + _data.remove_at(pos); } int find(const T &p_val) const { diff --git a/core/variant/array.cpp b/core/variant/array.cpp index 69a0fff1a1d..b049c296884 100644 --- a/core/variant/array.cpp +++ b/core/variant/array.cpp @@ -322,8 +322,8 @@ bool Array::has(const Variant &p_value) const { return _p->array.find(p_value, 0) != -1; } -void Array::remove(int p_pos) { - _p->array.remove(p_pos); +void Array::remove_at(int p_pos) { + _p->array.remove_at(p_pos); } void Array::set(int p_idx, const Variant &p_value) { @@ -576,7 +576,7 @@ Variant Array::pop_back() { Variant Array::pop_front() { if (!_p->array.is_empty()) { const Variant ret = _p->array.get(0); - _p->array.remove(0); + _p->array.remove_at(0); return ret; } return Variant(); @@ -603,7 +603,7 @@ Variant Array::pop_at(int p_pos) { _p->array.size())); const Variant ret = _p->array.get(p_pos); - _p->array.remove(p_pos); + _p->array.remove_at(p_pos); return ret; } diff --git a/core/variant/array.h b/core/variant/array.h index bd39b8e0b16..5d2839dda73 100644 --- a/core/variant/array.h +++ b/core/variant/array.h @@ -75,7 +75,7 @@ public: Error resize(int p_new_size); Error insert(int p_pos, const Variant &p_value); - void remove(int p_pos); + void remove_at(int p_pos); void fill(const Variant &p_value); Variant front() const; diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 65ea969146d..34b8b782d2a 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1808,7 +1808,7 @@ static void _register_variant_builtin_methods() { bind_method(Array, append_array, sarray("array"), varray()); bind_method(Array, resize, sarray("size"), varray()); bind_method(Array, insert, sarray("position", "value"), varray()); - bind_method(Array, remove, sarray("position"), varray()); + bind_method(Array, remove_at, sarray("position"), varray()); bind_method(Array, fill, sarray("value"), varray()); bind_method(Array, erase, sarray("value"), varray()); bind_method(Array, front, sarray(), varray()); @@ -1842,7 +1842,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedByteArray, push_back, sarray("value"), varray()); bind_method(PackedByteArray, append, sarray("value"), varray()); bind_method(PackedByteArray, append_array, sarray("array"), varray()); - bind_method(PackedByteArray, remove, sarray("index"), varray()); + bind_method(PackedByteArray, remove_at, sarray("index"), varray()); bind_method(PackedByteArray, insert, sarray("at_index", "value"), varray()); bind_method(PackedByteArray, fill, sarray("value"), varray()); bind_method(PackedByteArray, resize, sarray("new_size"), varray()); @@ -1903,7 +1903,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedInt32Array, push_back, sarray("value"), varray()); bind_method(PackedInt32Array, append, sarray("value"), varray()); bind_method(PackedInt32Array, append_array, sarray("array"), varray()); - bind_method(PackedInt32Array, remove, sarray("index"), varray()); + bind_method(PackedInt32Array, remove_at, sarray("index"), varray()); bind_method(PackedInt32Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedInt32Array, fill, sarray("value"), varray()); bind_method(PackedInt32Array, resize, sarray("new_size"), varray()); @@ -1923,7 +1923,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedInt64Array, push_back, sarray("value"), varray()); bind_method(PackedInt64Array, append, sarray("value"), varray()); bind_method(PackedInt64Array, append_array, sarray("array"), varray()); - bind_method(PackedInt64Array, remove, sarray("index"), varray()); + bind_method(PackedInt64Array, remove_at, sarray("index"), varray()); bind_method(PackedInt64Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedInt64Array, fill, sarray("value"), varray()); bind_method(PackedInt64Array, resize, sarray("new_size"), varray()); @@ -1943,7 +1943,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedFloat32Array, push_back, sarray("value"), varray()); bind_method(PackedFloat32Array, append, sarray("value"), varray()); bind_method(PackedFloat32Array, append_array, sarray("array"), varray()); - bind_method(PackedFloat32Array, remove, sarray("index"), varray()); + bind_method(PackedFloat32Array, remove_at, sarray("index"), varray()); bind_method(PackedFloat32Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedFloat32Array, fill, sarray("value"), varray()); bind_method(PackedFloat32Array, resize, sarray("new_size"), varray()); @@ -1963,7 +1963,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedFloat64Array, push_back, sarray("value"), varray()); bind_method(PackedFloat64Array, append, sarray("value"), varray()); bind_method(PackedFloat64Array, append_array, sarray("array"), varray()); - bind_method(PackedFloat64Array, remove, sarray("index"), varray()); + bind_method(PackedFloat64Array, remove_at, sarray("index"), varray()); bind_method(PackedFloat64Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedFloat64Array, fill, sarray("value"), varray()); bind_method(PackedFloat64Array, resize, sarray("new_size"), varray()); @@ -1983,7 +1983,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedStringArray, push_back, sarray("value"), varray()); bind_method(PackedStringArray, append, sarray("value"), varray()); bind_method(PackedStringArray, append_array, sarray("array"), varray()); - bind_method(PackedStringArray, remove, sarray("index"), varray()); + bind_method(PackedStringArray, remove_at, sarray("index"), varray()); bind_method(PackedStringArray, insert, sarray("at_index", "value"), varray()); bind_method(PackedStringArray, fill, sarray("value"), varray()); bind_method(PackedStringArray, resize, sarray("new_size"), varray()); @@ -2003,7 +2003,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedVector2Array, push_back, sarray("value"), varray()); bind_method(PackedVector2Array, append, sarray("value"), varray()); bind_method(PackedVector2Array, append_array, sarray("array"), varray()); - bind_method(PackedVector2Array, remove, sarray("index"), varray()); + bind_method(PackedVector2Array, remove_at, sarray("index"), varray()); bind_method(PackedVector2Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedVector2Array, fill, sarray("value"), varray()); bind_method(PackedVector2Array, resize, sarray("new_size"), varray()); @@ -2023,7 +2023,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedVector3Array, push_back, sarray("value"), varray()); bind_method(PackedVector3Array, append, sarray("value"), varray()); bind_method(PackedVector3Array, append_array, sarray("array"), varray()); - bind_method(PackedVector3Array, remove, sarray("index"), varray()); + bind_method(PackedVector3Array, remove_at, sarray("index"), varray()); bind_method(PackedVector3Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedVector3Array, fill, sarray("value"), varray()); bind_method(PackedVector3Array, resize, sarray("new_size"), varray()); @@ -2043,7 +2043,7 @@ static void _register_variant_builtin_methods() { bind_method(PackedColorArray, push_back, sarray("value"), varray()); bind_method(PackedColorArray, append, sarray("value"), varray()); bind_method(PackedColorArray, append_array, sarray("array"), varray()); - bind_method(PackedColorArray, remove, sarray("index"), varray()); + bind_method(PackedColorArray, remove_at, sarray("index"), varray()); bind_method(PackedColorArray, insert, sarray("at_index", "value"), varray()); bind_method(PackedColorArray, fill, sarray("value"), varray()); bind_method(PackedColorArray, resize, sarray("new_size"), varray()); diff --git a/core/variant/variant_setget.cpp b/core/variant/variant_setget.cpp index 2530d77c62a..b6ad2d870e8 100644 --- a/core/variant/variant_setget.cpp +++ b/core/variant/variant_setget.cpp @@ -704,7 +704,7 @@ struct VariantIndexedSetGet_String { String *b = VariantGetInternalPtr::get_ptr(base); const String *v = VariantInternal::get_string(value); if (v->length() == 0) { - b->remove(index); + b->remove_at(index); } else { b->set(index, v->get(0)); } @@ -723,7 +723,7 @@ struct VariantIndexedSetGet_String { String *b = VariantGetInternalPtr::get_ptr(base); const String *v = VariantInternal::get_string(value); if (v->length() == 0) { - b->remove(index); + b->remove_at(index); } else { b->set(index, v->get(0)); } @@ -738,7 +738,7 @@ struct VariantIndexedSetGet_String { OOB_TEST(index, v.length()); const String &m = *reinterpret_cast(member); if (unlikely(m.length() == 0)) { - v.remove(index); + v.remove_at(index); } else { v.set(index, m.unicode_at(0)); } diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index b74d4c1d3d5..d505ee98cc0 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -194,7 +194,7 @@ - Removes the first occurrence of a value from the array. To remove an element by index, use [method remove] instead. + Removes the first occurrence of a value from the array. To remove an element by index, use [method remove_at] instead. [b]Note:[/b] This method acts in-place and doesn't return a value. [b]Note:[/b] On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed. @@ -400,7 +400,7 @@ [/codeblock] - + diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index f951df1eb7a..fd098481e48 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -332,7 +332,7 @@ Appends an element at the end of the array. - + diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index 4aa8a19630d..f69c5504da2 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -95,7 +95,7 @@ Appends a value to the array. - + diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index 68fb45a62a6..ccac6073868 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -96,7 +96,7 @@ Appends an element at the end of the array. - + diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index 740591a0c0d..b164283b3ea 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -96,7 +96,7 @@ Appends an element at the end of the array. - + diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index 7a01bb6c7c1..c6ff31ebdd2 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -96,7 +96,7 @@ Appends a value to the array. - + diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index c7b69d4ad52..ff48eb1aad9 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -96,7 +96,7 @@ Appends a value to the array. - + diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index dfebfb718b4..4204277ea2f 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -96,7 +96,7 @@ Appends a string element at end of the array. - + diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index bf9b7e97d47..e6a7b2fa41a 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -96,7 +96,7 @@ Inserts a [Vector2] at the end. - + diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index b439f8f2174..6992bbca018 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -95,7 +95,7 @@ Inserts a [Vector3] at the end. - + diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index 3ca3576de69..dc0c62fbc92 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -847,7 +847,7 @@ void ActionMapEditor::_tree_button_pressed(Object *p_item, int p_column, int p_i int event_index = item->get_meta("__index"); Array events = action["events"]; - events.remove(event_index); + events.remove_at(event_index); action["events"] = events; emit_signal(SNAME("action_edited"), action_name, action); diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index b954c874767..d00fdd0ce7b 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -240,7 +240,7 @@ void ConnectDialog::_remove_bind() { int idx = st.get_slice("/", 1).to_int() - 1; ERR_FAIL_INDEX(idx, cdbinds->params.size()); - cdbinds->params.remove(idx); + cdbinds->params.remove_at(idx); cdbinds->notify_changed(); } @@ -723,7 +723,7 @@ void ConnectionsDock::_open_connection_dialog(TreeItem &item) { c = '_'; } else { // Remove any other characters. - midname.remove(i); + midname.remove_at(i); i--; continue; } diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 72aea9b630e..dec4f50f037 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -576,7 +576,7 @@ void CreateDialog::drop_data_fw(const Point2 &p_point, const Variant &p_data, Co drop_idx--; } - favorite_list.remove(from_idx); + favorite_list.remove_at(from_idx); if (ds < 0) { favorite_list.insert(drop_idx, type); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index aee9c210073..a163b468e62 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -70,7 +70,7 @@ void EditorHistory::cleanup_history() { } if (fail) { - history.remove(i); + history.remove_at(i); i--; } } @@ -510,7 +510,7 @@ void EditorData::remove_custom_type(const String &p_type) { for (Map>::Element *E = custom_types.front(); E; E = E->next()) { for (int i = 0; i < E->get().size(); i++) { if (E->get()[i].name == p_type) { - E->get().remove(i); + E->get().remove_at(i); if (E->get().is_empty()) { custom_types.erase(E->key()); } @@ -570,7 +570,7 @@ void EditorData::remove_scene(int p_idx) { ScriptEditor::get_singleton()->close_builtin_scripts_from_scene(edited_scene[p_idx].path); } - edited_scene.remove(p_idx); + edited_scene.remove_at(p_idx); } bool EditorData::_find_updated_instances(Node *p_root, Node *p_node, Set &checked_paths) { @@ -751,7 +751,7 @@ void EditorData::move_edited_scene_to_index(int p_idx) { ERR_FAIL_INDEX(p_idx, edited_scene.size()); EditedScene es = edited_scene[current_edited_scene]; - edited_scene.remove(current_edited_scene); + edited_scene.remove_at(current_edited_scene); edited_scene.insert(p_idx, es); current_edited_scene = p_idx; } diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index e78ca7cd641..03d91ebcbab 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -1534,7 +1534,7 @@ Ref EditorExport::get_export_preset(int p_idx) { } void EditorExport::remove_export_preset(int p_idx) { - export_presets.remove(p_idx); + export_presets.remove_at(p_idx); save_presets(); } diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 2d7c31b64cd..bea5c99c1af 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -302,7 +302,7 @@ void EditorFileDialog::_post_popup() { bool exists = dir_access->dir_exists(recentd[i]); if (!exists) { // Remove invalid directory from the list of Recent directories. - recentd.remove(i--); + recentd.remove_at(i--); } else { recent->add_item(name, folder); recent->set_item_metadata(recent->get_item_count() - 1, recentd[i]); @@ -1445,7 +1445,7 @@ void EditorFileDialog::_save_to_recent() { for (int i = 0; i < recent.size(); i++) { bool cres = recent[i].begins_with("res://"); if (recent[i] == dir || (res == cres && count > max)) { - recent.remove(i); + recent.remove_at(i); i--; } else { count++; diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index d1414470442..4f02a82fb56 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -577,7 +577,7 @@ bool EditorFileSystem::_update_scan_actions() { ERR_CONTINUE(idx == -1); _delete_internal_files(ia.dir->files[idx]->file); memdelete(ia.dir->files[idx]); - ia.dir->files.remove(idx); + ia.dir->files.remove_at(idx); fs_changed = true; @@ -1536,7 +1536,7 @@ void EditorFileSystem::update_file(const String &p_file) { } } memdelete(fs->files[cpos]); - fs->files.remove(cpos); + fs->files.remove_at(cpos); } call_deferred(SNAME("emit_signal"), "filesystem_changed"); //update later diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 2729b1eb3b5..e1fae470573 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1608,11 +1608,11 @@ void EditorInspectorArray::_move_element(int p_element_index, int p_to_pos) { properties_as_array.insert(p_to_pos < 0 ? properties_as_array.size() : p_to_pos, Dictionary()); } else if (p_to_pos < 0) { // Delete the element. - properties_as_array.remove(p_element_index); + properties_as_array.remove_at(p_element_index); } else { // Move the element. properties_as_array.insert(p_to_pos, properties_as_array[p_element_index].duplicate()); - properties_as_array.remove(p_to_pos < p_element_index ? p_element_index + 1 : p_element_index); + properties_as_array.remove_at(p_to_pos < p_element_index ? p_element_index + 1 : p_element_index); } // Change the array size then set the properties. diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 69a59b7ddb1..6aaf0b063f7 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -831,7 +831,7 @@ void EditorNode::_remove_plugin_from_enabled(const String &p_name) { PackedStringArray enabled_plugins = ps->get("editor_plugins/enabled"); for (int i = 0; i < enabled_plugins.size(); ++i) { if (enabled_plugins.get(i) == p_name) { - enabled_plugins.remove(i); + enabled_plugins.remove_at(i); break; } } @@ -3199,7 +3199,7 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor, bool p_config_chan } memdelete(singleton->main_editor_buttons[i]); - singleton->main_editor_buttons.remove(i); + singleton->main_editor_buttons.remove_at(i); break; } @@ -3758,7 +3758,7 @@ void EditorNode::_open_recent_scene(int p_idx) { ERR_FAIL_INDEX(p_idx, rc.size()); if (load_scene(rc[p_idx]) != OK) { - rc.remove(p_idx); + rc.remove_at(p_idx); EditorSettings::get_singleton()->set_project_metadata("recent_files", "scenes", rc); _update_recent_scenes(); } @@ -5177,7 +5177,7 @@ void EditorNode::remove_bottom_panel_item(Control *p_item) { bottom_panel_vb->remove_child(bottom_panel_items[i].control); bottom_panel_hb_editors->remove_child(bottom_panel_items[i].button); memdelete(bottom_panel_items[i].button); - bottom_panel_items.remove(i); + bottom_panel_items.remove_at(i); break; } } diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index a3b6f6e59b2..0f59c8281f4 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -413,7 +413,7 @@ void EditorPropertyArray::update_property() { void EditorPropertyArray::_remove_pressed(int p_index) { Variant array = object->get_array(); - array.call("remove", p_index); + array.call("remove_at", p_index); emit_changed(get_edited_property(), array, "", false); update_property(); diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index d7daa0c750c..0a77a8b0bb5 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -201,7 +201,7 @@ Error EditorRun::run(const String &p_scene, const String &p_custom_args, const L Vector exec_args = p_custom_args.substr(0, placeholder_pos).split(" ", false); if (exec_args.size() >= 1) { exec = exec_args[0]; - exec_args.remove(0); + exec_args.remove_at(0); // Append the Godot executable name before we append executable arguments // (since the order is reversed when using `push_front()`). diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 7ae3dcd44f3..f40a048b75f 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -197,7 +197,7 @@ Vector FileSystemDock::_compute_uncollapsed_paths() { child = child->get_next(); } } - needs_check.remove(0); + needs_check.remove_at(0); } } } @@ -1093,7 +1093,7 @@ void FileSystemDock::_push_to_history() { history_pos++; if (history.size() > history_max_size) { - history.remove(0); + history.remove_at(0); history_pos = history_max_size - 1; } } @@ -1670,7 +1670,7 @@ Vector FileSystemDock::_remove_self_included_paths(Vector select String last_path = ""; for (int i = 0; i < selected_strings.size(); i++) { if (last_path != "" && selected_strings[i].begins_with(last_path)) { - selected_strings.remove(i); + selected_strings.remove_at(i); i--; } if (selected_strings[i].ends_with("/")) { @@ -1704,7 +1704,7 @@ void FileSystemDock::_tree_rmb_option(int p_option) { child = child->get_next(); } - needs_check.remove(0); + needs_check.remove_at(0); } } } break; @@ -2229,7 +2229,7 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data, drop_position -= offset; to_remove.sort(); for (int i = 0; i < to_remove.size(); i++) { - dirs.remove(to_remove[i] - i); + dirs.remove_at(to_remove[i] - i); } // Re-add them at the right position. diff --git a/editor/import/collada.cpp b/editor/import/collada.cpp index 19b4943e6d6..c34379f1ec4 100644 --- a/editor/import/collada.cpp +++ b/editor/import/collada.cpp @@ -2024,7 +2024,7 @@ void Collada::_create_skeletons(Collada::Node **p_node, NodeSkeleton *p_skeleton bool Collada::_remove_node(Node *p_parent, Node *p_node) { for (int i = 0; i < p_parent->children.size(); i++) { if (p_parent->children[i] == p_node) { - p_parent->children.remove(i); + p_parent->children.remove_at(i); return true; } if (_remove_node(p_parent->children[i], p_node)) { @@ -2038,7 +2038,7 @@ bool Collada::_remove_node(Node *p_parent, Node *p_node) { void Collada::_remove_node(VisualScene *p_vscene, Node *p_node) { for (int i = 0; i < p_vscene->root_nodes.size(); i++) { if (p_vscene->root_nodes[i] == p_node) { - p_vscene->root_nodes.remove(i); + p_vscene->root_nodes.remove_at(i); return; } if (_remove_node(p_vscene->root_nodes[i], p_node)) { @@ -2271,7 +2271,7 @@ bool Collada::_move_geometry_to_skeletons(VisualScene *p_vscene, Node *p_node, L for (int i = 0; i < p_node->children.size(); i++) { if (_move_geometry_to_skeletons(p_vscene, p_node->children[i], p_mgeom)) { - p_node->children.remove(i); + p_node->children.remove_at(i); i--; } } @@ -2325,7 +2325,7 @@ void Collada::_optimize() { for (int i = 0; i < vs.root_nodes.size(); i++) { List mgeom; if (_move_geometry_to_skeletons(&vs, vs.root_nodes[i], &mgeom)) { - vs.root_nodes.remove(i); + vs.root_nodes.remove_at(i); i--; } diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp index 3fe1aa557d7..5c25e6aae96 100644 --- a/editor/localization_editor.cpp +++ b/editor/localization_editor.cpp @@ -98,7 +98,7 @@ void LocalizationEditor::_translation_delete(Object *p_item, int p_column, int p ERR_FAIL_INDEX(idx, translations.size()); - translations.remove(idx); + translations.remove_at(idx); undo_redo->create_action(TTR("Remove Translation")); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translations", translations); @@ -276,7 +276,7 @@ void LocalizationEditor::_translation_res_option_delete(Object *p_item, int p_co ERR_FAIL_COND(!remaps.has(key)); PackedStringArray r = remaps[key]; ERR_FAIL_INDEX(idx, r.size()); - r.remove(idx); + r.remove_at(idx); remaps[key] = r; undo_redo->create_action(TTR("Remove Resource Remap Option")); @@ -321,7 +321,7 @@ void LocalizationEditor::_translation_filter_option_changed() { } } else { if (l_idx != -1) { - f_locales.remove(l_idx); + f_locales.remove_at(l_idx); } } @@ -397,7 +397,7 @@ void LocalizationEditor::_pot_delete(Object *p_item, int p_column, int p_button) ERR_FAIL_INDEX(idx, pot_translations.size()); - pot_translations.remove(idx); + pot_translations.remove_at(idx); undo_redo->create_action(TTR("Remove file from POT generation")); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translations_pot_files", pot_translations); diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index 7cafbbc1c4f..58f92a98a66 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -446,7 +446,7 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref &p_event) if (k->get_keycode() == Key::KEY_DELETE || k->get_keycode() == Key::BACKSPACE) { if (wip_active && selected_point.polygon == -1) { if (wip.size() > selected_point.vertex) { - wip.remove(selected_point.vertex); + wip.remove_at(selected_point.vertex); _wip_changed(); selected_point = wip.size() - 1; canvas_item_editor->update_viewport(); @@ -599,7 +599,7 @@ void AbstractPolygon2DEditor::remove_point(const Vertex &p_vertex) { Vector vertices = _get_polygon(p_vertex.polygon); if (vertices.size() > (_is_line() ? 2 : 3)) { - vertices.remove(p_vertex.vertex); + vertices.remove_at(p_vertex.vertex); undo_redo->create_action(TTR("Edit Polygon (Remove Point)")); _action_set_polygon(p_vertex.polygon, vertices); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 2aded41810d..75d2bed1b29 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -58,7 +58,7 @@ void AnimationNodeBlendTreeEditor::add_custom_type(const String &p_name, const R void AnimationNodeBlendTreeEditor::remove_custom_type(const Ref