From ba0758cb4e6cbc22e5a01f04e6ee33adbf25c085 Mon Sep 17 00:00:00 2001 From: Lightning_A Date: Fri, 18 Jun 2021 15:11:23 -0600 Subject: [PATCH] Replace all instances of `erase` with `remove` Array's `remove()` method was renamed to `remove_at()` --- core/config/project_settings.cpp | 6 +- core/core_bind.cpp | 4 +- core/debugger/engine_debugger.cpp | 4 +- core/debugger/script_debugger.cpp | 4 +- core/input/input.cpp | 10 +- core/input/input_map.cpp | 16 +-- core/input/input_map.h | 6 +- core/io/config_file.cpp | 24 ++-- core/io/config_file.h | 4 +- core/io/dir_access.cpp | 8 +- core/io/dir_access.h | 2 +- core/io/file_access_network.cpp | 2 +- core/io/file_access_pack.h | 4 +- core/io/http_client.cpp | 8 +- core/io/image_loader.cpp | 2 +- core/io/ip.cpp | 12 +- core/io/ip.h | 2 +- core/io/json.cpp | 4 +- core/io/logger.h | 2 +- core/io/multiplayer_api.cpp | 6 +- core/io/resource.cpp | 8 +- core/io/resource_importer.h | 2 +- core/io/resource_loader.cpp | 4 +- core/io/udp_server.cpp | 4 +- core/math/a_star.cpp | 14 +-- core/math/bvh.h | 8 +- core/math/delaunay_2d.h | 4 +- core/math/delaunay_3d.h | 4 +- core/math/expression.cpp | 6 +- core/math/octree.h | 36 +++--- core/math/quick_hull.cpp | 8 +- core/object/object.cpp | 16 +-- core/object/script_language.cpp | 8 +- core/object/script_language.h | 2 +- core/object/undo_redo.cpp | 4 +- core/string/node_path.cpp | 6 +- core/string/translation.cpp | 10 +- core/string/translation.h | 2 +- core/string/translation_po.cpp | 4 +- core/string/translation_po.h | 2 +- core/string/ustring.cpp | 10 +- core/string/ustring.h | 2 +- core/templates/command_queue_mt.h | 2 +- core/templates/hash_map.h | 10 +- core/templates/list.h | 24 ++-- core/templates/local_vector.h | 2 +- core/templates/lru.h | 8 +- core/templates/map.h | 14 +-- core/templates/ordered_hash_map.h | 12 +- core/templates/set.h | 14 +-- core/templates/vector.h | 6 +- core/templates/vmap.h | 2 +- core/templates/vset.h | 4 +- core/variant/array.cpp | 12 +- core/variant/array.h | 4 +- core/variant/dictionary.cpp | 4 +- core/variant/dictionary.h | 2 +- core/variant/variant.cpp | 4 +- core/variant/variant_call.cpp | 26 ++--- doc/classes/Array.xml | 6 +- doc/classes/ColorPicker.xml | 2 +- doc/classes/ConfigFile.xml | 4 +- doc/classes/Dictionary.xml | 2 +- doc/classes/EditorSettings.xml | 2 +- doc/classes/IP.xml | 2 +- doc/classes/InputMap.xml | 6 +- 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 +- doc/classes/Polygon2D.xml | 2 +- doc/classes/Translation.xml | 2 +- doc/classes/TreeItem.xml | 2 +- drivers/vulkan/rendering_device_vulkan.cpp | 20 ++-- drivers/vulkan/rendering_device_vulkan.h | 2 +- drivers/vulkan/vulkan_context.cpp | 2 +- editor/action_map_editor.cpp | 2 +- editor/animation_bezier_editor.cpp | 2 +- editor/animation_track_editor.cpp | 6 +- editor/audio_stream_preview.cpp | 10 +- editor/connections_dialog.cpp | 2 +- editor/create_dialog.cpp | 4 +- editor/debugger/editor_debugger_node.cpp | 2 +- editor/debugger/editor_debugger_tree.cpp | 2 +- .../debugger/editor_performance_profiler.cpp | 6 +- editor/debugger/editor_profiler.cpp | 2 +- editor/debugger/script_editor_debugger.cpp | 4 +- editor/doc_tools.cpp | 16 +-- editor/doc_tools.h | 2 +- editor/editor_autoload_settings.cpp | 2 +- editor/editor_data.cpp | 18 +-- editor/editor_dir_dialog.cpp | 2 +- editor/editor_export.cpp | 14 +-- editor/editor_feature_profile.cpp | 36 +++--- editor/editor_feature_profile.h | 6 +- editor/editor_file_dialog.cpp | 6 +- editor/editor_file_system.cpp | 10 +- editor/editor_help.cpp | 8 +- editor/editor_inspector.cpp | 8 +- editor/editor_node.cpp | 38 +++---- editor/editor_properties_array_dict.cpp | 2 +- editor/editor_resource_preview.cpp | 6 +- editor/editor_run.cpp | 4 +- editor/editor_settings.cpp | 14 +-- editor/editor_settings.h | 2 +- editor/editor_translation_parser.cpp | 4 +- editor/export_template_manager.cpp | 2 +- editor/fileserver/editor_file_server.cpp | 6 +- editor/filesystem_dock.cpp | 12 +- editor/import/collada.cpp | 8 +- editor/import/resource_importer_scene.cpp | 4 +- editor/import/resource_importer_scene.h | 2 +- editor/import/scene_import_settings.cpp | 4 +- editor/import_dock.cpp | 4 +- editor/localization_editor.cpp | 10 +- editor/plugins/abstract_polygon_2d_editor.cpp | 8 +- .../animation_blend_space_1d_editor.cpp | 40 +++---- .../plugins/animation_blend_space_1d_editor.h | 8 +- .../animation_blend_space_2d_editor.cpp | 44 ++++---- .../plugins/animation_blend_space_2d_editor.h | 8 +- .../animation_blend_tree_editor_plugin.cpp | 14 +-- .../animation_state_machine_editor.cpp | 36 +++--- .../plugins/animation_state_machine_editor.h | 6 +- .../plugins/animation_tree_editor_plugin.cpp | 2 +- .../plugins/asset_library_editor_plugin.cpp | 4 +- editor/plugins/canvas_item_editor_plugin.cpp | 10 +- .../collision_polygon_3d_editor_plugin.cpp | 2 +- editor/plugins/item_list_editor_plugin.cpp | 8 +- editor/plugins/item_list_editor_plugin.h | 8 +- editor/plugins/mesh_library_editor_plugin.cpp | 6 +- editor/plugins/mesh_library_editor_plugin.h | 2 +- editor/plugins/node_3d_editor_plugin.cpp | 10 +- editor/plugins/polygon_2d_editor_plugin.cpp | 16 +-- editor/plugins/script_editor_plugin.cpp | 30 ++--- editor/plugins/script_editor_plugin.h | 2 +- editor/plugins/script_text_editor.cpp | 2 +- editor/plugins/shader_editor_plugin.h | 2 +- .../plugins/sprite_frames_editor_plugin.cpp | 6 +- .../plugins/texture_region_editor_plugin.cpp | 12 +- editor/plugins/theme_editor_plugin.cpp | 2 +- editor/plugins/tiles/tile_map_editor.cpp | 106 +++++++++--------- editor/plugins/tiles/tile_map_editor.h | 4 +- .../tiles/tile_set_atlas_source_editor.cpp | 26 ++--- .../tiles/tile_set_atlas_source_editor.h | 2 +- .../plugins/visual_shader_editor_plugin.cpp | 22 ++-- editor/progress_dialog.cpp | 4 +- editor/project_manager.cpp | 94 ++++++++-------- editor/project_manager.h | 18 +-- editor/project_settings_editor.cpp | 2 +- editor/scene_tree_dock.cpp | 24 ++-- editor/scene_tree_dock.h | 2 +- editor/settings_config_dialog.cpp | 10 +- editor/settings_config_dialog.h | 2 +- main/main.cpp | 6 +- main/performance.cpp | 2 +- modules/bullet/area_bullet.cpp | 4 +- modules/bullet/bullet_physics_server.cpp | 2 +- modules/bullet/collision_object_bullet.cpp | 8 +- modules/bullet/rigid_body_bullet.cpp | 2 +- modules/bullet/shape_bullet.cpp | 2 +- modules/bullet/soft_body_bullet.cpp | 2 +- modules/bullet/space_bullet.cpp | 2 +- modules/camera/camera_osx.h | 2 +- modules/camera/camera_win.cpp | 2 +- modules/camera/camera_win.h | 2 +- modules/camera/register_types.cpp | 4 +- modules/csg/csg.cpp | 16 +-- modules/enet/networked_multiplayer_enet.cpp | 8 +- modules/fbx/data/fbx_mesh_data.cpp | 8 +- modules/gdnative/gdnative.cpp | 6 +- .../gdnative_library_editor_plugin.cpp | 20 ++-- .../gdnative/gdnative_library_editor_plugin.h | 4 +- .../gdnative_library_singleton_editor.cpp | 2 +- .../gdnative/nativescript/nativescript.cpp | 28 ++--- modules/gdnative/nativescript/nativescript.h | 2 +- .../pluginscript/pluginscript_instance.cpp | 2 +- .../pluginscript/pluginscript_script.cpp | 4 +- .../pluginscript/pluginscript_script.h | 2 +- .../gdnative/text/text_server_gdnative.cpp | 2 +- modules/gdnavigation/nav_map.cpp | 8 +- modules/gdscript/gdscript.cpp | 28 ++--- modules/gdscript/gdscript.h | 2 +- modules/gdscript/gdscript_cache.cpp | 12 +- modules/gdscript/gdscript_compiler.cpp | 6 +- modules/gdscript/gdscript_function.cpp | 2 +- modules/gdscript/gdscript_parser.cpp | 4 +- .../gdscript_language_protocol.cpp | 4 +- .../language_server/gdscript_workspace.cpp | 8 +- modules/gridmap/grid_map.cpp | 20 ++-- modules/gridmap/grid_map_editor_plugin.cpp | 8 +- modules/gridmap/grid_map_editor_plugin.h | 2 +- modules/mono/csharp_script.cpp | 24 ++-- modules/mono/csharp_script.h | 2 +- modules/mono/editor/bindings_generator.cpp | 2 +- modules/mono/glue/collections_glue.cpp | 4 +- modules/mono/managed_callable.cpp | 2 +- modules/mono/mono_gd/gd_mono.cpp | 2 +- modules/raycast/raycast_occlusion_cull.cpp | 12 +- modules/text_server_adv/bitmap_font_adv.cpp | 2 +- modules/text_server_adv/text_server_adv.cpp | 4 +- modules/text_server_fb/bitmap_font_fb.cpp | 2 +- modules/text_server_fb/text_server_fb.cpp | 4 +- modules/upnp/upnp.cpp | 2 +- modules/visual_script/visual_script.cpp | 36 +++--- modules/visual_script/visual_script.h | 2 +- .../visual_script/visual_script_editor.cpp | 10 +- .../visual_script_expression.cpp | 6 +- modules/visual_script/visual_script_nodes.cpp | 6 +- modules/webrtc/webrtc_multiplayer.cpp | 2 +- .../editor_debugger_server_websocket.cpp | 2 +- .../websocket/websocket_multiplayer_peer.cpp | 2 +- modules/websocket/wsl_server.cpp | 4 +- platform/android/api/jni_singleton.h | 10 +- platform/android/display_server_android.cpp | 2 +- platform/android/export/export.cpp | 6 +- platform/android/java_class_wrapper.cpp | 2 +- platform/iphone/export/export.cpp | 8 +- platform/linuxbsd/crash_handler_linuxbsd.cpp | 2 +- platform/linuxbsd/display_server_x11.cpp | 10 +- platform/linuxbsd/joypad_linux.cpp | 2 +- platform/osx/export/export.cpp | 2 +- platform/osx/joypad_osx.cpp | 2 +- platform/uwp/export/export.cpp | 2 +- platform/windows/display_server_windows.cpp | 14 +-- platform/windows/os_windows.cpp | 2 +- scene/2d/area_2d.cpp | 8 +- scene/2d/collision_object_2d.cpp | 4 +- scene/2d/line_2d.cpp | 2 +- scene/2d/navigation_region_2d.cpp | 2 +- scene/2d/physics_body_2d.cpp | 4 +- scene/2d/polygon_2d.cpp | 6 +- scene/2d/polygon_2d.h | 2 +- scene/2d/ray_cast_2d.cpp | 6 +- scene/2d/skeleton_2d.cpp | 2 +- scene/2d/tile_map.cpp | 18 +-- scene/2d/tile_map.h | 2 +- scene/3d/area_3d.cpp | 8 +- scene/3d/camera_3d.cpp | 2 +- scene/3d/collision_object_3d.cpp | 4 +- scene/3d/node_3d.cpp | 2 +- scene/3d/physics_body_3d.cpp | 4 +- scene/3d/proximity_group_3d.cpp | 2 +- scene/3d/ray_cast_3d.cpp | 6 +- scene/3d/skeleton_3d.cpp | 4 +- scene/3d/soft_body_3d.cpp | 2 +- scene/3d/spring_arm_3d.cpp | 2 +- scene/3d/sprite_3d.cpp | 2 +- scene/3d/vehicle_body_3d.cpp | 2 +- scene/3d/visual_instance_3d.cpp | 2 +- scene/animation/animation_blend_space_2d.cpp | 10 +- scene/animation/animation_blend_tree.cpp | 6 +- scene/animation/animation_cache.cpp | 4 +- .../animation_node_state_machine.cpp | 16 +-- scene/animation/animation_player.cpp | 38 +++---- scene/animation/animation_tree.cpp | 20 ++-- scene/animation/tween.cpp | 8 +- scene/debugger/scene_debugger.cpp | 10 +- scene/gui/base_button.cpp | 4 +- scene/gui/button.cpp | 2 +- scene/gui/code_edit.cpp | 10 +- scene/gui/color_picker.cpp | 8 +- scene/gui/color_picker.h | 2 +- scene/gui/control.cpp | 24 ++-- scene/gui/gradient_edit.cpp | 4 +- scene/gui/graph_edit.cpp | 28 ++--- scene/gui/graph_node.cpp | 6 +- scene/gui/grid_container.cpp | 4 +- scene/gui/item_list.cpp | 4 +- scene/gui/label.cpp | 2 +- scene/gui/line_edit.cpp | 10 +- scene/gui/link_button.cpp | 2 +- scene/gui/popup_menu.cpp | 4 +- scene/gui/range.cpp | 2 +- scene/gui/rich_text_label.cpp | 14 +-- scene/gui/tabs.cpp | 4 +- scene/gui/text_edit.cpp | 10 +- scene/gui/tree.cpp | 6 +- scene/gui/tree.h | 4 +- scene/main/canvas_item.cpp | 6 +- scene/main/node.cpp | 10 +- scene/main/resource_preloader.cpp | 4 +- scene/main/scene_tree.cpp | 12 +- scene/main/scene_tree.h | 2 +- scene/main/viewport.cpp | 44 ++++---- scene/main/window.cpp | 2 +- scene/resources/animation.cpp | 68 +++++------ scene/resources/bit_map.cpp | 4 +- scene/resources/curve.cpp | 8 +- scene/resources/font.cpp | 2 +- scene/resources/gradient.cpp | 2 +- scene/resources/material.cpp | 4 +- scene/resources/mesh_library.cpp | 2 +- scene/resources/particles_material.cpp | 4 +- scene/resources/polygon_path_finder.cpp | 6 +- scene/resources/shader.cpp | 2 +- .../skeleton_modification_stack_2d.cpp | 2 +- scene/resources/sprite_frames.cpp | 6 +- scene/resources/syntax_highlighter.cpp | 8 +- scene/resources/texture.cpp | 14 +-- scene/resources/texture.h | 6 +- scene/resources/theme.cpp | 24 ++-- scene/resources/tile_set.cpp | 42 +++---- scene/resources/visual_shader.cpp | 42 +++---- scene/resources/world_3d.cpp | 2 +- servers/audio/audio_stream.cpp | 4 +- servers/audio_server.cpp | 16 +-- servers/camera/camera_feed.cpp | 34 +++--- servers/camera/camera_feed.h | 4 +- servers/camera_server.cpp | 44 ++++---- servers/camera_server.h | 24 ++-- servers/physics_2d/area_2d_sw.cpp | 8 +- servers/physics_2d/area_2d_sw.h | 2 +- servers/physics_2d/body_2d_sw.h | 6 +- servers/physics_2d/body_pair_2d_sw.cpp | 10 +- servers/physics_2d/broad_phase_2d_bvh.cpp | 2 +- servers/physics_2d/collision_object_2d_sw.cpp | 4 +- servers/physics_2d/physics_server_2d_sw.cpp | 4 +- servers/physics_2d/shape_2d_sw.cpp | 2 +- servers/physics_2d/space_2d_sw.cpp | 2 +- servers/physics_3d/area_3d_sw.cpp | 8 +- servers/physics_3d/area_3d_sw.h | 2 +- servers/physics_3d/body_3d_sw.h | 6 +- servers/physics_3d/body_pair_3d_sw.cpp | 4 +- servers/physics_3d/broad_phase_3d_bvh.cpp | 2 +- servers/physics_3d/collision_object_3d_sw.cpp | 4 +- servers/physics_3d/physics_server_3d_sw.cpp | 4 +- servers/physics_3d/shape_3d_sw.cpp | 2 +- servers/physics_3d/soft_body_3d_sw.h | 4 +- servers/physics_3d/space_3d_sw.cpp | 2 +- servers/register_server_types.cpp | 4 +- servers/rendering/renderer_canvas_cull.cpp | 30 ++--- servers/rendering/renderer_canvas_cull.h | 4 +- .../render_forward_clustered.cpp | 2 +- .../scene_shader_forward_clustered.cpp | 2 +- .../scene_shader_forward_mobile.cpp | 2 +- .../renderer_rd/renderer_canvas_render_rd.cpp | 12 +- .../renderer_rd/renderer_compositor_rd.cpp | 2 +- .../renderer_rd/renderer_scene_gi_rd.cpp | 2 +- .../renderer_rd/renderer_scene_gi_rd.h | 2 +- .../renderer_rd/renderer_scene_render_rd.cpp | 38 +++---- .../renderer_rd/renderer_scene_render_rd.h | 2 +- .../renderer_rd/renderer_scene_sky_rd.cpp | 2 +- .../renderer_rd/renderer_storage_rd.cpp | 48 ++++---- .../renderer_rd/renderer_storage_rd.h | 2 +- servers/rendering/renderer_rd/shader_rd.cpp | 2 +- servers/rendering/renderer_scene_cull.cpp | 48 ++++---- servers/rendering/renderer_storage.cpp | 4 +- servers/rendering/renderer_storage.h | 6 +- servers/rendering/renderer_viewport.cpp | 8 +- servers/rendering/rendering_device_binds.h | 2 +- servers/rendering/shader_language.cpp | 8 +- servers/text_server.cpp | 2 +- servers/xr_server.cpp | 8 +- tests/test_array.h | 10 +- tests/test_class_db.h | 2 +- tests/test_list.h | 20 ++-- tests/test_local_vector.h | 4 +- tests/test_lru.h | 2 +- tests/test_math.cpp | 2 +- tests/test_ordered_hash_map.h | 8 +- tests/test_render.cpp | 2 +- tests/test_string.h | 2 +- tests/test_translation.h | 4 +- tests/test_vector.h | 38 +++---- .../basis_universal/encoder/basisu_enc.cpp | 2 +- .../basis_universal/encoder/basisu_enc.h | 2 +- .../encoder/basisu_frontend.cpp | 6 +- .../basis_universal/transcoder/basisu.h | 2 +- .../transcoder/basisu_containers.h | 18 +-- .../transcoder/basisu_containers_impl.h | 4 +- .../BulletCollision/Gimpact/gim_array.h | 8 +- .../BulletCollision/Gimpact/gim_hash_table.h | 36 +++--- .../BulletSoftBody/btSoftBodyHelpers.cpp | 2 +- thirdparty/embree/common/sys/alloc.h | 4 +- .../common/tasking/taskschedulerinternal.cpp | 2 +- thirdparty/embree/kernels/common/device.cpp | 4 +- thirdparty/enet/godot.cpp | 2 +- thirdparty/glslang/SPIRV/InReadableOrder.cpp | 4 +- thirdparty/glslang/SPIRV/SPVRemapper.cpp | 36 +++--- thirdparty/glslang/SPIRV/SpvBuilder.h | 2 +- thirdparty/glslang/SPIRV/SpvPostProcess.cpp | 2 +- thirdparty/glslang/SPIRV/spvIR.h | 2 +- thirdparty/glslang/glslang/Include/InfoSink.h | 2 +- thirdparty/glslang/glslang/Include/arrays.h | 2 +- .../MachineIndependent/ParseHelper.cpp | 2 +- .../glslang/MachineIndependent/ShaderLang.cpp | 6 +- .../glslang/MachineIndependent/SymbolTable.h | 2 +- .../MachineIndependent/linkValidate.cpp | 2 +- .../MachineIndependent/localintermediate.h | 4 +- .../propagateNoContraction.cpp | 4 +- thirdparty/graphite/src/Collider.cpp | 2 +- thirdparty/graphite/src/Intervals.cpp | 2 +- thirdparty/graphite/src/inc/List.h | 10 +- thirdparty/misc/clipper.cpp | 2 +- thirdparty/misc/polypartition.cpp | 12 +- thirdparty/oidn/mkl-dnn/src/cpu/xbyak/xbyak.h | 12 +- thirdparty/tinyexr/tinyexr.h | 2 +- thirdparty/vhacd/inc/vhacdSArray.h | 2 +- thirdparty/vulkan/vk_mem_alloc.h | 18 +-- 403 files changed, 1655 insertions(+), 1655 deletions(-) diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 74ef05b797f1..63a99513baef 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -167,7 +167,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) { _THREAD_SAFE_METHOD_ if (p_value.get_type() == Variant::NIL) { - props.erase(p_name); + props.remove(p_name); if (p_name.operator String().begins_with("autoload/")) { String node_name = p_name.operator String().split("/")[1]; if (autoloads.has(node_name)) { @@ -680,7 +680,7 @@ bool ProjectSettings::is_builtin_setting(const String &p_name) const { void ProjectSettings::clear(const String &p_name) { ERR_FAIL_COND_MSG(!props.has(p_name), "Request for nonexistent project setting: " + p_name + "."); - props.erase(p_name); + props.remove(p_name); } Error ProjectSettings::save() { @@ -1022,7 +1022,7 @@ void ProjectSettings::add_autoload(const AutoloadInfo &p_autoload) { void ProjectSettings::remove_autoload(const StringName &p_autoload) { ERR_FAIL_COND_MSG(!autoloads.has(p_autoload), "Trying to remove non-existent autoload."); - autoloads.erase(p_autoload); + autoloads.remove(p_autoload); } bool ProjectSettings::has_autoload(const StringName &p_autoload) const { diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 60759cd71c0d..d55a73632963 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -2250,7 +2250,7 @@ void _EngineDebugger::register_profiler(const StringName &p_name, const Callable void _EngineDebugger::unregister_profiler(const StringName &p_name) { ERR_FAIL_COND_MSG(!profilers.has(p_name), "Profiler not registered: " + p_name); EngineDebugger::unregister_profiler(p_name); - profilers.erase(p_name); + profilers.remove(p_name); } bool _EngineDebugger::_EngineDebugger::is_profiling(const StringName &p_name) { @@ -2282,7 +2282,7 @@ void _EngineDebugger::register_message_capture(const StringName &p_name, const C void _EngineDebugger::unregister_message_capture(const StringName &p_name) { ERR_FAIL_COND_MSG(!captures.has(p_name), "Capture not registered: " + p_name); EngineDebugger::unregister_message_capture(p_name); - captures.erase(p_name); + captures.remove(p_name); } bool _EngineDebugger::has_capture(const StringName &p_name) { diff --git a/core/debugger/engine_debugger.cpp b/core/debugger/engine_debugger.cpp index e5dba029c9e3..1bdd951ecc4e 100644 --- a/core/debugger/engine_debugger.cpp +++ b/core/debugger/engine_debugger.cpp @@ -55,7 +55,7 @@ void EngineDebugger::unregister_profiler(const StringName &p_name) { p.toggle(p.data, false, Array()); p.active = false; } - profilers.erase(p_name); + profilers.remove(p_name); } void EngineDebugger::register_message_capture(const StringName &p_name, Capture p_func) { @@ -65,7 +65,7 @@ void EngineDebugger::register_message_capture(const StringName &p_name, Capture void EngineDebugger::unregister_message_capture(const StringName &p_name) { ERR_FAIL_COND_MSG(!captures.has(p_name), "Capture not registered: " + p_name); - captures.erase(p_name); + captures.remove(p_name); } void EngineDebugger::register_uri_handler(const String &p_protocol, CreatePeerFunc p_func) { diff --git a/core/debugger/script_debugger.cpp b/core/debugger/script_debugger.cpp index 6d1e4ed1014e..d98032e145e9 100644 --- a/core/debugger/script_debugger.cpp +++ b/core/debugger/script_debugger.cpp @@ -60,9 +60,9 @@ void ScriptDebugger::remove_breakpoint(int p_line, const StringName &p_source) { return; } - breakpoints[p_line].erase(p_source); + breakpoints[p_line].remove(p_source); if (breakpoints[p_line].size() == 0) { - breakpoints.erase(p_line); + breakpoints.remove(p_line); } } diff --git a/core/input/input.cpp b/core/input/input.cpp index 6e98b596d73b..8c6c6edb98f5 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -430,7 +430,7 @@ void Input::joy_connection_changed(int p_idx, bool p_connected, String p_name, S js.connected = false; for (int i = 0; i < JOY_BUTTON_MAX; i++) { int c = _combine_device(i, p_idx); - joy_buttons_pressed.erase(c); + joy_buttons_pressed.remove(c); } for (int i = 0; i < JOY_AXIS_MAX; i++) { set_joy_axis(p_idx, i, 0.0f); @@ -480,7 +480,7 @@ void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_em if (k->is_pressed()) { keys_pressed.insert(k->get_keycode()); } else { - keys_pressed.erase(k->get_keycode()); + keys_pressed.remove(k->get_keycode()); } } @@ -536,7 +536,7 @@ void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_em } else { // Since a pointer index may not occur again (OSs may or may not reuse them), // imperatively remove it from the map to keep no fossil entries in it - touch_speed_track.erase(st->get_index()); + touch_speed_track.remove(st->get_index()); } if (emulate_mouse_from_touch) { @@ -603,7 +603,7 @@ void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_em if (jb->is_pressed()) { joy_buttons_pressed.insert(c); } else { - joy_buttons_pressed.erase(c); + joy_buttons_pressed.remove(c); } } @@ -1342,7 +1342,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 (Map::Element *E = joy_names.front(); E; E = E->next()) { diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp index c43fd6456143..87eb6b2965c8 100644 --- a/core/input/input_map.cpp +++ b/core/input/input_map.cpp @@ -42,13 +42,13 @@ void InputMap::_bind_methods() { ClassDB::bind_method(D_METHOD("has_action", "action"), &InputMap::has_action); ClassDB::bind_method(D_METHOD("get_actions"), &InputMap::_get_actions); ClassDB::bind_method(D_METHOD("add_action", "action", "deadzone"), &InputMap::add_action, DEFVAL(0.5f)); - ClassDB::bind_method(D_METHOD("erase_action", "action"), &InputMap::erase_action); + ClassDB::bind_method(D_METHOD("remove_action", "action"), &InputMap::remove_action); ClassDB::bind_method(D_METHOD("action_set_deadzone", "action", "deadzone"), &InputMap::action_set_deadzone); ClassDB::bind_method(D_METHOD("action_add_event", "action", "event"), &InputMap::action_add_event); ClassDB::bind_method(D_METHOD("action_has_event", "action", "event"), &InputMap::action_has_event); - ClassDB::bind_method(D_METHOD("action_erase_event", "action", "event"), &InputMap::action_erase_event); - ClassDB::bind_method(D_METHOD("action_erase_events", "action"), &InputMap::action_erase_events); + ClassDB::bind_method(D_METHOD("action_remove_event", "action", "event"), &InputMap::action_remove_event); + ClassDB::bind_method(D_METHOD("action_remove_events", "action"), &InputMap::action_remove_events); ClassDB::bind_method(D_METHOD("action_get_events", "action"), &InputMap::_action_get_events); ClassDB::bind_method(D_METHOD("event_is_action", "event", "action", "exact_match"), &InputMap::event_is_action, DEFVAL(false)); ClassDB::bind_method(D_METHOD("load_from_project_settings"), &InputMap::load_from_project_settings); @@ -91,10 +91,10 @@ void InputMap::add_action(const StringName &p_action, float p_deadzone) { last_id++; } -void InputMap::erase_action(const StringName &p_action) { +void InputMap::remove_action(const StringName &p_action) { ERR_FAIL_COND_MSG(!input_map.has(p_action), _suggest_actions(p_action)); - input_map.erase(p_action); + input_map.remove(p_action); } Array InputMap::_get_actions() { @@ -177,19 +177,19 @@ bool InputMap::action_has_event(const StringName &p_action, const Ref &p_event) { +void InputMap::action_remove_event(const StringName &p_action, const Ref &p_event) { ERR_FAIL_COND_MSG(!input_map.has(p_action), _suggest_actions(p_action)); List>::Element *E = _find_event(input_map[p_action], p_event, true); if (E) { - input_map[p_action].inputs.erase(E); + input_map[p_action].inputs.remove(E); if (Input::get_singleton()->is_action_pressed(p_action)) { Input::get_singleton()->action_release(p_action); } } } -void InputMap::action_erase_events(const StringName &p_action) { +void InputMap::action_remove_events(const StringName &p_action) { ERR_FAIL_COND_MSG(!input_map.has(p_action), _suggest_actions(p_action)); input_map[p_action].inputs.clear(); diff --git a/core/input/input_map.h b/core/input/input_map.h index 0e0567464a52..e36f6daec156 100644 --- a/core/input/input_map.h +++ b/core/input/input_map.h @@ -72,14 +72,14 @@ class InputMap : public Object { bool has_action(const StringName &p_action) const; List get_actions() const; void add_action(const StringName &p_action, float p_deadzone = 0.5); - void erase_action(const StringName &p_action); + void remove_action(const StringName &p_action); float action_get_deadzone(const StringName &p_action); void action_set_deadzone(const StringName &p_action, float p_deadzone); void action_add_event(const StringName &p_action, const Ref &p_event); bool action_has_event(const StringName &p_action, const Ref &p_event); - void action_erase_event(const StringName &p_action, const Ref &p_event); - void action_erase_events(const StringName &p_action); + void action_remove_event(const StringName &p_action, const Ref &p_event); + void action_remove_events(const StringName &p_action); const List> *action_get_events(const StringName &p_action); bool event_is_action(const Ref &p_event, const StringName &p_action, bool p_exact_match = false) const; diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index 10f68f3cef57..cd6f1c05e3be 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -62,13 +62,13 @@ PackedStringArray ConfigFile::_get_section_keys(const String &p_section) const { void ConfigFile::set_value(const String &p_section, const String &p_key, const Variant &p_value) { if (p_value.get_type() == Variant::NIL) { - //erase + //remove if (!values.has(p_section)) { return; // ? } - values[p_section].erase(p_key); + values[p_section].remove(p_key); if (values[p_section].is_empty()) { - values.erase(p_section); + values.remove(p_section); } } else { @@ -115,16 +115,16 @@ void ConfigFile::get_section_keys(const String &p_section, List *r_keys) } } -void ConfigFile::erase_section(const String &p_section) { - ERR_FAIL_COND_MSG(!values.has(p_section), vformat("Cannot erase nonexistent section \"%s\".", p_section)); - values.erase(p_section); +void ConfigFile::remove_section(const String &p_section) { + ERR_FAIL_COND_MSG(!values.has(p_section), vformat("Cannot remove nonexistent section \"%s\".", p_section)); + values.remove(p_section); } -void ConfigFile::erase_section_key(const String &p_section, const String &p_key) { - ERR_FAIL_COND_MSG(!values.has(p_section), vformat("Cannot erase key \"%s\" from nonexistent section \"%s\".", p_key, p_section)); - ERR_FAIL_COND_MSG(!values[p_section].has(p_key), vformat("Cannot erase nonexistent key \"%s\" from section \"%s\".", p_key, p_section)); +void ConfigFile::remove_section_key(const String &p_section, const String &p_key) { + ERR_FAIL_COND_MSG(!values.has(p_section), vformat("Cannot remove key \"%s\" from nonexistent section \"%s\".", p_key, p_section)); + ERR_FAIL_COND_MSG(!values[p_section].has(p_key), vformat("Cannot remove nonexistent key \"%s\" from section \"%s\".", p_key, p_section)); - values[p_section].erase(p_key); + values[p_section].remove(p_key); } Error ConfigFile::save(const String &p_path) { @@ -308,8 +308,8 @@ void ConfigFile::_bind_methods() { ClassDB::bind_method(D_METHOD("get_sections"), &ConfigFile::_get_sections); ClassDB::bind_method(D_METHOD("get_section_keys", "section"), &ConfigFile::_get_section_keys); - ClassDB::bind_method(D_METHOD("erase_section", "section"), &ConfigFile::erase_section); - ClassDB::bind_method(D_METHOD("erase_section_key", "section", "key"), &ConfigFile::erase_section_key); + ClassDB::bind_method(D_METHOD("remove_section", "section"), &ConfigFile::remove_section); + ClassDB::bind_method(D_METHOD("remove_section_key", "section", "key"), &ConfigFile::remove_section_key); ClassDB::bind_method(D_METHOD("load", "path"), &ConfigFile::load); ClassDB::bind_method(D_METHOD("parse", "data"), &ConfigFile::parse); diff --git a/core/io/config_file.h b/core/io/config_file.h index dbba43ace572..5a3cde7b2cb0 100644 --- a/core/io/config_file.h +++ b/core/io/config_file.h @@ -61,8 +61,8 @@ class ConfigFile : public RefCounted { void get_sections(List *r_sections) const; void get_section_keys(const String &p_section, List *r_keys) const; - void erase_section(const String &p_section); - void erase_section_key(const String &p_section, const String &p_key); + void remove_section(const String &p_section); + void remove_section_key(const String &p_section, const String &p_key); Error save(const String &p_path); Error load(const String &p_path); diff --git a/core/io/dir_access.cpp b/core/io/dir_access.cpp index dfba00067f34..e6ddb0614172 100644 --- a/core/io/dir_access.cpp +++ b/core/io/dir_access.cpp @@ -73,7 +73,7 @@ bool DirAccess::drives_are_shortcuts() { return false; } -static Error _erase_recursive(DirAccess *da) { +static Error _remove_recursive(DirAccess *da) { List dirs; List files; @@ -96,7 +96,7 @@ static Error _erase_recursive(DirAccess *da) { for (List::Element *E = dirs.front(); E; E = E->next()) { Error err = da->change_dir(E->get()); if (err == OK) { - err = _erase_recursive(da); + err = _remove_recursive(da); if (err) { da->change_dir(".."); return err; @@ -124,8 +124,8 @@ static Error _erase_recursive(DirAccess *da) { return OK; } -Error DirAccess::erase_contents_recursive() { - return _erase_recursive(this); +Error DirAccess::remove_contents_recursive() { + return _remove_recursive(this); } Error DirAccess::make_dir_recursive(String p_dir) { diff --git a/core/io/dir_access.h b/core/io/dir_access.h index 16154a4850b8..1818e6bc8e35 100644 --- a/core/io/dir_access.h +++ b/core/io/dir_access.h @@ -80,7 +80,7 @@ class DirAccess { virtual String get_current_dir(bool p_include_drive = true) = 0; ///< return current dir location virtual Error make_dir(String p_dir) = 0; virtual Error make_dir_recursive(String p_dir); - virtual Error erase_contents_recursive(); //super dangerous, use with care! + virtual Error remove_contents_recursive(); //super dangerous, use with care! virtual bool file_exists(String p_file) = 0; virtual bool dir_exists(String p_dir) = 0; diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index 63a8f9c5b600..62d50ffa33fd 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -488,6 +488,6 @@ FileAccessNetwork::~FileAccessNetwork() { FileAccessNetworkClient *nc = FileAccessNetworkClient::singleton; nc->lock_mutex(); id = nc->last_id++; - nc->accesses.erase(id); + nc->accesses.remove(id); nc->unlock_mutex(); } diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h index 2f0ee627239c..30d8a581cdfb 100644 --- a/core/io/file_access_pack.h +++ b/core/io/file_access_pack.h @@ -61,7 +61,7 @@ class PackedData { public: struct PackedFile { String pack; - uint64_t offset; //if offset is ZERO, the file was ERASED + uint64_t offset; //if offset is ZERO, the file was REMOVED uint64_t size; uint8_t md5[16]; PackSource *src; @@ -193,7 +193,7 @@ FileAccess *PackedData::try_open_path(const String &p_path) { return nullptr; //not found } if (E->get().offset == 0) { - return nullptr; //was erased + return nullptr; //was removed } return E->get().src->get_file(p_path, &E->get()); diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 449ebaa6ee1b..40217faee4b1 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -302,7 +302,7 @@ void HTTPClient::close() { status = STATUS_DISCONNECTED; head_request = false; if (resolving != IP::RESOLVER_INVALID_ID) { - IP::get_singleton()->erase_resolve_item(resolving); + IP::get_singleton()->remove_resolve_item(resolving); resolving = IP::RESOLVER_INVALID_ID; } @@ -330,7 +330,7 @@ Error HTTPClient::poll() { case IP::RESOLVER_STATUS_DONE: { IPAddress host = IP::get_singleton()->get_resolve_item_address(resolving); Error err = tcp_connection->connect_to_host(host, conn_port); - IP::get_singleton()->erase_resolve_item(resolving); + IP::get_singleton()->remove_resolve_item(resolving); resolving = IP::RESOLVER_INVALID_ID; if (err) { status = STATUS_CANT_CONNECT; @@ -341,7 +341,7 @@ Error HTTPClient::poll() { } break; case IP::RESOLVER_STATUS_NONE: case IP::RESOLVER_STATUS_ERROR: { - IP::get_singleton()->erase_resolve_item(resolving); + IP::get_singleton()->remove_resolve_item(resolving); resolving = IP::RESOLVER_INVALID_ID; close(); status = STATUS_CANT_RESOLVE; @@ -763,7 +763,7 @@ String HTTPClient::query_string_from_dict(const Dictionary &p_dict) { } } } - query.erase(0, 1); + query.remove(0, 1); return query; } diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp index 7de038e6fe5c..286575afd096 100644 --- a/core/io/image_loader.cpp +++ b/core/io/image_loader.cpp @@ -107,7 +107,7 @@ void ImageLoader::add_image_format_loader(ImageFormatLoader *p_loader) { } void ImageLoader::remove_image_format_loader(ImageFormatLoader *p_loader) { - loader.erase(p_loader); + loader.remove(p_loader); } const Vector &ImageLoader::get_image_format_loaders() { diff --git a/core/io/ip.cpp b/core/io/ip.cpp index 001b1c47574b..b79995efd9e9 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -227,7 +227,7 @@ Array IP::get_resolve_item_addresses(ResolverID p_id) const { return result; } -void IP::erase_resolve_item(ResolverID p_id) { +void IP::remove_resolve_item(ResolverID p_id) { ERR_FAIL_INDEX(p_id, IP::RESOLVER_MAX_QUERIES); MutexLock lock(resolver->mutex); @@ -241,10 +241,10 @@ void IP::clear_cache(const String &p_hostname) { if (p_hostname.is_empty()) { resolver->cache.clear(); } else { - resolver->cache.erase(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_NONE)); - resolver->cache.erase(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_IPV4)); - resolver->cache.erase(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_IPV6)); - resolver->cache.erase(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_ANY)); + resolver->cache.remove(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_NONE)); + resolver->cache.remove(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_IPV4)); + resolver->cache.remove(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_IPV6)); + resolver->cache.remove(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_ANY)); } } @@ -299,7 +299,7 @@ void IP::_bind_methods() { ClassDB::bind_method(D_METHOD("get_resolve_item_status", "id"), &IP::get_resolve_item_status); ClassDB::bind_method(D_METHOD("get_resolve_item_address", "id"), &IP::get_resolve_item_address); ClassDB::bind_method(D_METHOD("get_resolve_item_addresses", "id"), &IP::get_resolve_item_addresses); - ClassDB::bind_method(D_METHOD("erase_resolve_item", "id"), &IP::erase_resolve_item); + ClassDB::bind_method(D_METHOD("remove_resolve_item", "id"), &IP::remove_resolve_item); ClassDB::bind_method(D_METHOD("get_local_addresses"), &IP::_get_local_addresses); ClassDB::bind_method(D_METHOD("get_local_interfaces"), &IP::_get_local_interfaces); ClassDB::bind_method(D_METHOD("clear_cache", "hostname"), &IP::clear_cache, DEFVAL("")); diff --git a/core/io/ip.h b/core/io/ip.h index 3c6040a1f083..618dfc8cb593 100644 --- a/core/io/ip.h +++ b/core/io/ip.h @@ -94,7 +94,7 @@ class IP : public Object { Array get_resolve_item_addresses(ResolverID p_id) const; virtual void get_local_interfaces(Map *r_interfaces) const = 0; - void erase_resolve_item(ResolverID p_id); + void remove_resolve_item(ResolverID p_id); void clear_cache(const String &p_hostname = ""); diff --git a/core/io/json.cpp b/core/io/json.cpp index 82ef2a689467..16c753b7184b 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -103,7 +103,7 @@ String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_ s += _make_indent(p_indent, p_cur_indent + 1) + _print_var(a[i], p_indent, p_cur_indent + 1, p_sort_keys, p_markers); } s += end_statement + _make_indent(p_indent, p_cur_indent) + "]"; - p_markers.erase(a.id()); + p_markers.remove(a.id()); return s; } case Variant::DICTIONARY: { @@ -132,7 +132,7 @@ String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_ } s += end_statement + _make_indent(p_indent, p_cur_indent) + "}"; - p_markers.erase(d.id()); + p_markers.remove(d.id()); return s; } default: diff --git a/core/io/logger.h b/core/io/logger.h index ccf68562d6a2..c968d8070c12 100644 --- a/core/io/logger.h +++ b/core/io/logger.h @@ -74,7 +74,7 @@ class StdLogger : public Logger { /** * Writes messages to the specified file. If the file already exists, creates a copy (backup) * of it with timestamp appended to the file name. Maximum number of backups is configurable. - * When maximum is reached, the oldest backups are erased. With the maximum being equal to 1, + * When maximum is reached, the oldest backups are removed. With the maximum being equal to 1, * it acts as a simple file logger. */ class RotatedFileLogger : public Logger { diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp index 51ba8800e43f..309511cbf04f 100644 --- a/core/io/multiplayer_api.cpp +++ b/core/io/multiplayer_api.cpp @@ -945,16 +945,16 @@ void MultiplayerAPI::_add_peer(int p_id) { } void MultiplayerAPI::_del_peer(int p_id) { - connected_peers.erase(p_id); + connected_peers.remove(p_id); // Cleanup get cache. - path_get_cache.erase(p_id); + path_get_cache.remove(p_id); // Cleanup sent cache. // Some refactoring is needed to make this faster and do paths GC. List keys; path_send_cache.get_key_list(&keys); for (List::Element *E = keys.front(); E; E = E->next()) { PathSentCache *psc = path_send_cache.getptr(E->get()); - psc->confirmed_peers.erase(p_id); + psc->confirmed_peers.remove(p_id); } emit_signal("network_peer_disconnected", p_id); } diff --git a/core/io/resource.cpp b/core/io/resource.cpp index b970e85c9929..37d193b0b67d 100644 --- a/core/io/resource.cpp +++ b/core/io/resource.cpp @@ -53,7 +53,7 @@ void Resource::set_path(const String &p_path, bool p_take_over) { if (path_cache != "") { ResourceCache::lock.write_lock(); - ResourceCache::resources.erase(path_cache); + ResourceCache::resources.remove(path_cache); ResourceCache::lock.write_unlock(); } @@ -265,7 +265,7 @@ void Resource::register_owner(Object *p_owner) { } void Resource::unregister_owner(Object *p_owner) { - owners.erase(p_owner->get_instance_id()); + owners.remove(p_owner->get_instance_id()); } void Resource::notify_change_to_owners() { @@ -353,7 +353,7 @@ bool Resource::is_translation_remapped() const { void Resource::set_id_for_path(const String &p_path, int p_id) { if (p_id == -1) { ResourceCache::path_cache_lock.write_lock(); - ResourceCache::resource_path_cache[p_path].erase(get_path()); + ResourceCache::resource_path_cache[p_path].remove(get_path()); ResourceCache::path_cache_lock.write_unlock(); } else { ResourceCache::path_cache_lock.write_lock(); @@ -404,7 +404,7 @@ Resource::Resource() : Resource::~Resource() { if (path_cache != "") { ResourceCache::lock.write_lock(); - ResourceCache::resources.erase(path_cache); + ResourceCache::resources.remove(path_cache); ResourceCache::lock.write_unlock(); } if (owners.size()) { diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h index 2ceeb176e50f..b0b3b029ac92 100644 --- a/core/io/resource_importer.h +++ b/core/io/resource_importer.h @@ -80,7 +80,7 @@ class ResourceFormatImporter : public ResourceFormatLoader { void add_importer(const Ref &p_importer) { importers.push_back(p_importer); } - void remove_importer(const Ref &p_importer) { importers.erase(p_importer); } + void remove_importer(const Ref &p_importer) { importers.remove(p_importer); } Ref get_importer_by_name(const String &p_name) const; Ref get_importer_by_extension(const String &p_extension) const; void get_importers_for_extension(const String &p_extension, List> *r_importers); diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 1700766cbf63..bb56312a031c 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -476,7 +476,7 @@ RES ResourceLoader::load_threaded_get(const String &p_path, Error *r_error) { thread_suspended_count--; - if (!thread_load_tasks.has(local_path)) { //may have been erased during unlock and this was always an invalid call + if (!thread_load_tasks.has(local_path)) { //may have been removed during unlock and this was always an invalid call thread_load_mutex->unlock(); if (r_error) { *r_error = ERR_INVALID_PARAMETER; @@ -497,7 +497,7 @@ RES ResourceLoader::load_threaded_get(const String &p_path, Error *r_error) { load_task.thread->wait_to_finish(); memdelete(load_task.thread); } - thread_load_tasks.erase(local_path); + thread_load_tasks.remove(local_path); } thread_load_mutex->unlock(); diff --git a/core/io/udp_server.cpp b/core/io/udp_server.cpp index 6a1af0c2a97e..f7a3f5f25a50 100644 --- a/core/io/udp_server.cpp +++ b/core/io/udp_server.cpp @@ -148,7 +148,7 @@ void UDPServer::set_max_pending_connections(int p_max) { break; } memdelete(E->get().peer); - pending.erase(E); + pending.remove(E); } } @@ -174,7 +174,7 @@ void UDPServer::remove_peer(IPAddress p_ip, int p_port) { peer.port = p_port; List::Element *E = peers.find(peer); if (E) { - peers.erase(E); + peers.remove(E); } } diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 88e11a630cd9..e5b68aa68c87 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -115,7 +115,7 @@ void AStar::remove_point(int p_id) { for (OAHashMap::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) { Segment s(p_id, (*it.key)); - segments.erase(s); + segments.remove(s); (*it.value)->neighbours.remove(p->id); (*it.value)->unlinked_neighbours.remove(p->id); @@ -123,7 +123,7 @@ void AStar::remove_point(int p_id) { for (OAHashMap::Iterator it = p->unlinked_neighbours.iter(); it.valid; it = p->unlinked_neighbours.next_iter(it)) { Segment s(p_id, (*it.key)); - segments.erase(s); + segments.remove(s); (*it.value)->neighbours.remove(p->id); (*it.value)->unlinked_neighbours.remove(p->id); @@ -166,7 +166,7 @@ void AStar::connect_points(int p_id, int p_with_id, bool bidirectional) { a->unlinked_neighbours.remove(b->id); b->unlinked_neighbours.remove(a->id); } - segments.erase(element); + segments.remove(element); } segments.insert(s); @@ -187,7 +187,7 @@ void AStar::disconnect_points(int p_id, int p_with_id, bool bidirectional) { Set::Element *element = segments.find(s); if (element != nullptr) { // s is the new segment - // Erase the directions to be removed + // Remove the directions to be removed s.direction = (element->get().direction & ~remove_direction); a->neighbours.remove(b->id); @@ -205,7 +205,7 @@ void AStar::disconnect_points(int p_id, int p_with_id, bool bidirectional) { } } - segments.erase(element); + segments.remove(element); if (s.direction != Segment::NONE) { segments.insert(s); } @@ -350,7 +350,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)) { @@ -814,7 +814,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 cefbc9b0db85..9776029f7699 100644 --- a/core/math/bvh.h +++ b/core/math/bvh.h @@ -129,10 +129,10 @@ class BVH_Manager { move(h, p_aabb); } - void erase(uint32_t p_handle) { + void remove(uint32_t p_handle) { BVHHandle h; h.set(p_handle); - erase(h); + remove(h); } void force_collision_check(uint32_t p_handle) { @@ -186,7 +186,7 @@ class BVH_Manager { } } - void erase(BVHHandle p_handle) { + void remove(BVHHandle p_handle) { // call unpair and remove all references to the item // before deleting from the tree if (USE_PAIRS) { @@ -249,7 +249,7 @@ class BVH_Manager { if (USE_PAIRS) { _remove_changed_item(p_handle); - // force check for collisions, much like an erase was called + // force check for collisions, much like an remove was called _check_for_collisions(true); } return true; diff --git a/core/math/delaunay_2d.h b/core/math/delaunay_2d.h index 95064e570044..f68b2075b909 100644 --- a/core/math/delaunay_2d.h +++ b/core/math/delaunay_2d.h @@ -123,7 +123,7 @@ class Delaunay2D { for (int j = 0; j < triangles.size(); j++) { if (triangles[j].bad) { - triangles.remove(j); + triangles.remove_at(j); j--; } } @@ -154,7 +154,7 @@ class Delaunay2D { } } if (invalid) { - triangles.remove(i); + triangles.remove_at(i); i--; } } diff --git a/core/math/delaunay_3d.h b/core/math/delaunay_3d.h index 6f7209556e38..2f29697586fb 100644 --- a/core/math/delaunay_3d.h +++ b/core/math/delaunay_3d.h @@ -312,11 +312,11 @@ class Delaunay3D { } //remove simplex and continue - simplex_list.erase(simplex->SE); + simplex_list.remove(simplex->SE); for (uint32_t k = 0; k < simplex->grid_positions.size(); k++) { Vector3i p = simplex->grid_positions[k].pos; - acceleration_grid[p.x][p.y][p.z].erase(simplex->grid_positions[k].E); + acceleration_grid[p.x][p.y][p.z].remove(simplex->grid_positions[k].E); } memdelete(simplex); } diff --git a/core/math/expression.cpp b/core/math/expression.cpp index 0146c345f002..6bb0c71a14cb 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/math/octree.h b/core/math/octree.h index 493a63aa2e17..70ec3ab0dd14 100644 --- a/core/math/octree.h +++ b/core/math/octree.h @@ -250,9 +250,9 @@ class Octree { SWAP(p_A, p_B); } - p_A->pair_list.erase(E->get().eA); - p_B->pair_list.erase(E->get().eB); - pair_map.erase(E); + p_A->pair_list.remove(E->get().eA); + p_B->pair_list.remove(E->get().eB); + pair_map.remove(E); } } @@ -327,7 +327,7 @@ class Octree { OctreeElementID create(T *p_userdata, const AABB &p_aabb = AABB(), int p_subindex = 0, bool p_pairable = false, uint32_t p_pairable_type = 0, uint32_t pairable_mask = 1); void move(OctreeElementID p_id, const AABB &p_aabb); void set_pairable(OctreeElementID p_id, bool p_pairable = false, uint32_t p_pairable_type = 0, uint32_t pairable_mask = 1); - void erase(OctreeElementID p_id); + void remove(OctreeElementID p_id); bool is_pairable(OctreeElementID p_id) const; T *get(OctreeElementID p_id) const; @@ -542,7 +542,7 @@ bool Octree::_remove_element_from_octant(Element *p_element, O while (true) { // check all exit conditions - if (p_octant == p_limit) { // reached limit, nothing to erase, exit + if (p_octant == p_limit) { // reached limit, nothing to remove, exit return octant_removed; } @@ -573,9 +573,9 @@ bool Octree::_remove_element_from_octant(Element *p_element, O Octant *parent = p_octant->parent; if (p_octant->children_count == 0 && p_octant->elements.is_empty() && p_octant->pairable_elements.is_empty()) { - // erase octant + // remove octant - if (p_octant == root) { // won't have a parent, just erase + if (p_octant == root) { // won't have a parent, just remove root = nullptr; } else { @@ -687,7 +687,7 @@ void Octree::_remove_element(Element *p_element) { Octant *o = I->get().octant; if (!use_pairs) { // small speedup - o->elements.erase(I->get().E); + o->elements.remove(I->get().E); } _remove_element_from_octant(p_element, o); @@ -701,7 +701,7 @@ void Octree::_remove_element(Element *p_element) { for (; I; I = I->next()) { Octant *o = I->get().octant; - // erase children pairs, they are erased ONCE even if repeated + // remove children pairs, they are removed ONCE even if repeated pass++; for (int i = 0; i < 8; i++) { if (o->children[i]) { @@ -710,9 +710,9 @@ void Octree::_remove_element(Element *p_element) { } if (p_element->pairable) { - o->pairable_elements.erase(I->get().E); + o->pairable_elements.remove(I->get().E); } else { - o->elements.erase(I->get().E); + o->elements.remove(I->get().E); } } } @@ -856,17 +856,17 @@ void Octree::move(OctreeElementID p_id, const AABB &p_aabb) { /* if (!use_pairs) - o->elements.erase( F->get().E ); + o->elements.remove( F->get().E ); */ if (use_pairs && e.pairable) { - o->pairable_elements.erase(F->get().E); + o->pairable_elements.remove(F->get().E); } else { - o->elements.erase(F->get().E); + o->elements.remove(F->get().E); } if (_remove_element_from_octant(&e, o, common_parent->parent)) { - owners.erase(F); + owners.remove(F); } F = N; @@ -877,7 +877,7 @@ void Octree::move(OctreeElementID p_id, const AABB &p_aabb) { for (typename List::Element *F = owners.front(); F; F = F->next()) { Octant *o = F->get().octant; - // erase children pairs, unref ONCE + // remove children pairs, unref ONCE pass++; for (int i = 0; i < 8; i++) { if (o->children[i]) { @@ -922,7 +922,7 @@ void Octree::set_pairable(OctreeElementID p_id, bool p_pairabl } template -void Octree::erase(OctreeElementID p_id) { +void Octree::remove(OctreeElementID p_id) { typename ElementMap::Element *E = element_map.find(p_id); ERR_FAIL_COND(!E); @@ -932,7 +932,7 @@ void Octree::erase(OctreeElementID p_id) { _remove_element(&e); } - element_map.erase(p_id); + element_map.remove(p_id); _optimize(); } diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp index 0d77bfe93393..a2f799c58c92 100644 --- a/core/math/quick_hull.cpp +++ b/core/math/quick_hull.cpp @@ -311,10 +311,10 @@ Error QuickHull::build(const Vector &p_points, Geometry3D::MeshData &r_ } } - //erase lit faces + //remove lit faces while (lit_faces.size()) { - faces.erase(lit_faces.front()->get()); + faces.remove(lit_faces.front()->get()); lit_faces.pop_front(); } @@ -428,8 +428,8 @@ Error QuickHull::build(const Vector &p_points, Geometry3D::MeshData &r_ } } - ret_edges.erase(F); //remove the edge - ret_faces.erase(O); //remove the face + ret_edges.remove(F); //remove the edge + ret_faces.remove(O); //remove the face } } } diff --git a/core/object/object.cpp b/core/object/object.cpp index 799e63a512da..368f204ef4ef 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -912,7 +912,7 @@ bool Object::has_meta(const String &p_name) const { void Object::set_meta(const String &p_name, const Variant &p_value) { if (p_value.get_type() == Variant::NIL) { - metadata.erase(p_name); + metadata.remove(p_name); return; } @@ -925,7 +925,7 @@ Variant Object::get_meta(const String &p_name) const { } void Object::remove_meta(const String &p_name) { - metadata.erase(p_name); + metadata.remove(p_name); } Array Object::_get_property_list_bind() const { @@ -1399,12 +1399,12 @@ void Object::_disconnect(const StringName &p_signal, const Callable &p_callable, } } - target_object->connections.erase(slot->cE); - s->slot_map.erase(*p_callable.get_base_comparator()); + target_object->connections.remove(slot->cE); + s->slot_map.remove(*p_callable.get_base_comparator()); if (s->slot_map.is_empty() && ClassDB::has_signal(get_class_name(), p_signal)) { //not user signal, delete - signal_map.erase(p_signal); + signal_map.remove(p_signal); } } @@ -1500,7 +1500,7 @@ void Object::editor_set_section_unfold(const String &p_section, bool p_unfolded) if (p_unfolded) { editor_section_folding.insert(p_section); } else { - editor_section_folding.erase(p_section); + editor_section_folding.remove(p_section); } } @@ -1832,10 +1832,10 @@ Object::~Object() { const VMap::Pair *slot_list = s->slot_map.get_array(); for (int i = 0; i < slot_count; i++) { - slot_list[i].value.conn.callable.get_object()->connections.erase(slot_list[i].value.cE); + slot_list[i].value.conn.callable.get_object()->connections.remove(slot_list[i].value.cE); } - signal_map.erase(*S); + signal_map.remove(*S); } //signals from nodes that connect to this node diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index dd6bc09abbfb..729cbe70558e 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -219,7 +219,7 @@ void ScriptServer::add_global_class(const StringName &p_class, const StringName } void ScriptServer::remove_global_class(const StringName &p_class) { - global_classes.erase(p_class); + global_classes.remove(p_class); } bool ScriptServer::is_global_class(const StringName &p_class) { @@ -388,7 +388,7 @@ bool PlaceHolderScriptInstance::set(const StringName &p_name, const Variant &p_v Variant defval; if (script->get_property_default_value(p_name, defval)) { if (defval == p_value) { - values.erase(p_name); + values.remove(p_name); return true; } } @@ -518,7 +518,7 @@ void PlaceHolderScriptInstance::update(const List &p_properties, c } while (to_remove.size()) { - values.erase(to_remove.front()->get()); + values.remove(to_remove.front()->get()); to_remove.pop_front(); } @@ -593,6 +593,6 @@ PlaceHolderScriptInstance::PlaceHolderScriptInstance(ScriptLanguage *p_language, PlaceHolderScriptInstance::~PlaceHolderScriptInstance() { if (script.is_valid()) { - script->_placeholder_erased(this); + script->_placeholder_removed(this); } } diff --git a/core/object/script_language.h b/core/object/script_language.h index a22e91870eb6..2c097086029b 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -106,7 +106,7 @@ class Script : public Resource { static void _bind_methods(); friend class PlaceHolderScriptInstance; - virtual void _placeholder_erased(PlaceHolderScriptInstance *p_placeholder) {} + virtual void _placeholder_removed(PlaceHolderScriptInstance *p_placeholder) {} Variant _get_property_default_value(const StringName &p_property); Array _get_script_property_list(); diff --git a/core/object/undo_redo.cpp b/core/object/undo_redo.cpp index 96c96c1efbf8..d93e6522ee88 100644 --- a/core/object/undo_redo.cpp +++ b/core/object/undo_redo.cpp @@ -47,7 +47,7 @@ void UndoRedo::_discard_redo() { } } } - //ERASE do data + //REMOVE do data } actions.resize(current_action + 1); @@ -249,7 +249,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 d3afa7b4dd4a..7a212a208c98 100644 --- a/core/string/node_path.cpp +++ b/core/string/node_path.cpp @@ -286,12 +286,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/translation.cpp b/core/string/translation.cpp index 153f0190fd1d..00ab821a77b7 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -886,12 +886,12 @@ StringName Translation::get_plural_message(const StringName &p_src_text, const S return get_message(p_src_text); } -void Translation::erase_message(const StringName &p_src_text, const StringName &p_context) { +void Translation::remove_message(const StringName &p_src_text, const StringName &p_context) { if (p_context != StringName()) { - WARN_PRINT("Translation class doesn't handle context. Using context in erase_message() on a Translation instance is probably a mistake. \nUse a derived Translation class that handles context, such as TranslationPO class"); + WARN_PRINT("Translation class doesn't handle context. Using context in remove_message() on a Translation instance is probably a mistake. \nUse a derived Translation class that handles context, such as TranslationPO class"); } - translation_map.erase(p_src_text); + translation_map.remove(p_src_text); } void Translation::get_message_list(List *r_messages) const { @@ -911,7 +911,7 @@ void Translation::_bind_methods() { ClassDB::bind_method(D_METHOD("add_plural_message", "src_message", "xlated_messages", "context"), &Translation::add_plural_message, DEFVAL("")); ClassDB::bind_method(D_METHOD("get_message", "src_message", "context"), &Translation::get_message, DEFVAL("")); ClassDB::bind_method(D_METHOD("get_plural_message", "src_message", "src_plural_message", "n", "context"), &Translation::get_plural_message, DEFVAL("")); - ClassDB::bind_method(D_METHOD("erase_message", "src_message", "context"), &Translation::erase_message, DEFVAL("")); + ClassDB::bind_method(D_METHOD("remove_message", "src_message", "context"), &Translation::remove_message, DEFVAL("")); ClassDB::bind_method(D_METHOD("get_message_list"), &Translation::_get_message_list); ClassDB::bind_method(D_METHOD("get_message_count"), &Translation::get_message_count); ClassDB::bind_method(D_METHOD("_set_messages"), &Translation::_set_messages); @@ -1048,7 +1048,7 @@ void TranslationServer::add_translation(const Ref &p_translation) { } void TranslationServer::remove_translation(const Ref &p_translation) { - translations.erase(p_translation); + translations.remove(p_translation); } Ref TranslationServer::get_translation_object(const String &p_locale) { diff --git a/core/string/translation.h b/core/string/translation.h index 72a828227e52..c7c1708f5332 100644 --- a/core/string/translation.h +++ b/core/string/translation.h @@ -56,7 +56,7 @@ class Translation : public Resource { virtual void add_plural_message(const StringName &p_src_text, const Vector &p_plural_xlated_texts, const StringName &p_context = ""); virtual StringName get_message(const StringName &p_src_text, const StringName &p_context = "") const; //overridable for other implementations virtual StringName get_plural_message(const StringName &p_src_text, const StringName &p_plural_text, int p_n, const StringName &p_context = "") const; - virtual void erase_message(const StringName &p_src_text, const StringName &p_context = ""); + virtual void remove_message(const StringName &p_src_text, const StringName &p_context = ""); virtual void get_message_list(List *r_messages) const; virtual int get_message_count() const; diff --git a/core/string/translation_po.cpp b/core/string/translation_po.cpp index d6b84cabc91d..76bbff8cf18b 100644 --- a/core/string/translation_po.cpp +++ b/core/string/translation_po.cpp @@ -266,12 +266,12 @@ StringName TranslationPO::get_plural_message(const StringName &p_src_text, const return translation_map[p_context][p_src_text][plural_index]; } -void TranslationPO::erase_message(const StringName &p_src_text, const StringName &p_context) { +void TranslationPO::remove_message(const StringName &p_src_text, const StringName &p_context) { if (!translation_map.has(p_context)) { return; } - translation_map[p_context].erase(p_src_text); + translation_map[p_context].remove(p_src_text); } void TranslationPO::get_message_list(List *r_messages) const { diff --git a/core/string/translation_po.h b/core/string/translation_po.h index 0e1d03d6ca33..9e605b6ab921 100644 --- a/core/string/translation_po.h +++ b/core/string/translation_po.h @@ -76,7 +76,7 @@ class TranslationPO : public Translation { void add_plural_message(const StringName &p_src_text, const Vector &p_plural_xlated_texts, const StringName &p_context = "") override; StringName get_message(const StringName &p_src_text, const StringName &p_context = "") const override; StringName get_plural_message(const StringName &p_src_text, const StringName &p_plural_text, int p_n, const StringName &p_context = "") const override; - void erase_message(const StringName &p_src_text, const StringName &p_context = "") override; + void remove_message(const StringName &p_src_text, const StringName &p_context = "") override; void set_plural_rule(const String &p_plural_rule); int get_plural_forms() const; diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 16ecd2b9850d..28ece93c1d1c 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -938,7 +938,7 @@ const char32_t *String::get_data() const { return size() ? &operator[](0) : &zero; } -void String::erase(int p_pos, int p_chars) { +void String::remove(int p_pos, int p_chars) { *this = left(MAX(p_pos, 0)) + substr(p_pos + p_chars, length() - ((p_pos + p_chars))); } @@ -3741,15 +3741,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 ffb354d6e1c3..0cfc5feebdf4 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -368,7 +368,7 @@ class String { String plus_file(const String &p_file) const; char32_t unicode_at(int p_idx) const; - void erase(int p_pos, int p_chars); + void remove(int p_pos, int p_chars); CharString ascii(bool p_allow_extended = false) const; CharString utf8() const; diff --git a/core/templates/command_queue_mt.h b/core/templates/command_queue_mt.h index acc46da0d54c..96186bc810f7 100644 --- a/core/templates/command_queue_mt.h +++ b/core/templates/command_queue_mt.h @@ -372,7 +372,7 @@ class CommandQueueMT { cmd->call(); //execute the function cmd->post(); //release in case it needs sync/ret - cmd->~CommandBase(); //should be done, so erase the command + cmd->~CommandBase(); //should be done, so remove the command read_ptr += size; } diff --git a/core/templates/hash_map.h b/core/templates/hash_map.h index 1257b54449de..a0110801cf6d 100644 --- a/core/templates/hash_map.h +++ b/core/templates/hash_map.h @@ -109,8 +109,8 @@ class HashMap { } } - void erase_hash_table() { - ERR_FAIL_COND_MSG(elements, "Cannot erase hash table if there are still elements inside."); + void remove_hash_table() { + ERR_FAIL_COND_MSG(elements, "Cannot remove hash table if there are still elements inside."); memdelete_arr(hash_table); hash_table = nullptr; @@ -377,10 +377,10 @@ class HashMap { } /** - * Erase an item, return true if erasing was successful + * Remove an item, return true if erasing was successful */ - bool erase(const TKey &p_key) { + bool remove(const TKey &p_key) { if (unlikely(!hash_table)) { return false; } @@ -404,7 +404,7 @@ class HashMap { elements--; if (elements == 0) { - erase_hash_table(); + remove_hash_table(); } else { check_hash_table(); } diff --git a/core/templates/list.h b/core/templates/list.h index 010e35eed856..518eafe949a6 100644 --- a/core/templates/list.h +++ b/core/templates/list.h @@ -128,8 +128,8 @@ class List { value = (T &)p_value; } - void erase() { - data->erase(this); + void remove() { + data->remove(this); } _FORCE_INLINE_ Element() {} @@ -141,7 +141,7 @@ class List { Element *last = nullptr; int size_cache = 0; - bool erase(const Element *p_I) { + bool remove(const Element *p_I) { ERR_FAIL_COND_V(!p_I, false); ERR_FAIL_COND_V(p_I->data != this, false); @@ -234,7 +234,7 @@ class List { void pop_back() { if (_data && _data->last) { - erase(_data->last); + remove(_data->last); } } @@ -272,7 +272,7 @@ class List { void pop_front() { if (_data && _data->first) { - erase(_data->first); + remove(_data->first); } } @@ -345,11 +345,11 @@ class List { } /** - * erase an element in the list, by iterator pointing to it. Return true if it was found/erased. + * remove an element in the list, by iterator pointing to it. Return true if it was found/removed. */ - bool erase(const Element *p_I) { + bool remove(const Element *p_I) { if (_data && p_I) { - bool ret = _data->erase(p_I); + bool ret = _data->remove(p_I); if (_data->size_cache == 0) { memdelete_allocator<_Data, A>(_data); @@ -363,11 +363,11 @@ class List { } /** - * erase the first element in the list, that contains value + * remove the first element in the list, that contains value */ - bool erase(const T &value) { + bool remove(const T &value) { Element *I = find(value); - return erase(I); + return remove(I); } /** @@ -382,7 +382,7 @@ class List { */ void clear() { while (front()) { - erase(front()); + remove(front()); } } diff --git a/core/templates/local_vector.h b/core/templates/local_vector.h index 5f22e08eb8b4..ace3a81d19a6 100644 --- a/core/templates/local_vector.h +++ b/core/templates/local_vector.h @@ -94,7 +94,7 @@ class LocalVector { } } - void erase(const T &p_val) { + void remove(const T &p_val) { int64_t idx = find(p_val); if (idx >= 0) { remove(idx); diff --git a/core/templates/lru.h b/core/templates/lru.h index e55e40da48f3..92950fa32d33 100644 --- a/core/templates/lru.h +++ b/core/templates/lru.h @@ -61,14 +61,14 @@ class LRUCache { Element n = _list.push_front(Pair(p_key, p_value)); if (e) { - _list.erase(*e); - _map.erase(p_key); + _list.remove(*e); + _map.remove(p_key); } _map[p_key] = _list.front(); while (_map.size() > capacity) { Element d = _list.back(); - _map.erase(d->get().key); + _map.remove(d->get().key); _list.pop_back(); } @@ -108,7 +108,7 @@ class LRUCache { capacity = p_capacity; while (_map.size() > capacity) { Element d = _list.back(); - _map.erase(d->get().key); + _map.remove(d->get().key); _list.pop_back(); } } diff --git a/core/templates/map.h b/core/templates/map.h index 7dfee13d2c93..4a18709de0d2 100644 --- a/core/templates/map.h +++ b/core/templates/map.h @@ -350,7 +350,7 @@ class Map { return new_node; } - void _erase_fix_rb(Element *p_node) { + void _remove_fix_rb(Element *p_node) { Element *root = _data._root->left; Element *node = _data._nil; Element *sibling = p_node; @@ -411,7 +411,7 @@ class Map { ERR_FAIL_COND(_data._nil->color != BLACK); } - void _erase(Element *p_node) { + void _remove(Element *p_node) { Element *rp = ((p_node->left == _data._nil) || (p_node->right == _data._nil)) ? p_node : p_node->_next; Element *node = (rp->left == _data._nil) ? rp->right : rp->left; @@ -428,7 +428,7 @@ class Map { node->parent = rp->parent; _set_color(node, BLACK); } else if (rp->color == BLACK && rp->parent != _data._root) { - _erase_fix_rb(sibling); + _remove_fix_rb(sibling); } if (rp != p_node) { @@ -543,18 +543,18 @@ class Map { return _insert(p_key, p_value); } - void erase(Element *p_element) { + void remove(Element *p_element) { if (!_data._root || !p_element) { return; } - _erase(p_element); + _remove(p_element); if (_data.size_cache == 0 && _data._root) { _data._free_root(); } } - bool erase(const K &p_key) { + bool remove(const K &p_key) { if (!_data._root) { return false; } @@ -564,7 +564,7 @@ class Map { return false; } - _erase(e); + _remove(e); if (_data.size_cache == 0 && _data._root) { _data._free_root(); } diff --git a/core/templates/ordered_hash_map.h b/core/templates/ordered_hash_map.h index 7a17eeb644c5..0e83229bd443 100644 --- a/core/templates/ordered_hash_map.h +++ b/core/templates/ordered_hash_map.h @@ -214,17 +214,17 @@ class OrderedHashMap { return Element(new_element); } - void erase(Element &p_element) { - map.erase(p_element.key()); - list.erase(p_element.list_element); + void remove(Element &p_element) { + map.remove(p_element.key()); + list.remove(p_element.list_element); p_element.list_element = nullptr; } - bool erase(const K &p_key) { + bool remove(const K &p_key) { typename InternalList::Element **list_element = map.getptr(p_key); if (list_element) { - list.erase(*list_element); - map.erase(p_key); + list.remove(*list_element); + map.remove(p_key); return true; } return false; diff --git a/core/templates/set.h b/core/templates/set.h index 3036ecf27de6..b64889569b4a 100644 --- a/core/templates/set.h +++ b/core/templates/set.h @@ -335,7 +335,7 @@ class Set { return new_node; } - void _erase_fix_rb(Element *p_node) { + void _remove_fix_rb(Element *p_node) { Element *root = _data._root->left; Element *node = _data._nil; Element *sibling = p_node; @@ -396,7 +396,7 @@ class Set { ERR_FAIL_COND(_data._nil->color != BLACK); } - void _erase(Element *p_node) { + void _remove(Element *p_node) { Element *rp = ((p_node->left == _data._nil) || (p_node->right == _data._nil)) ? p_node : p_node->_next; Element *node = (rp->left == _data._nil) ? rp->right : rp->left; @@ -413,7 +413,7 @@ class Set { node->parent = rp->parent; _set_color(node, BLACK); } else if (rp->color == BLACK && rp->parent != _data._root) { - _erase_fix_rb(sibling); + _remove_fix_rb(sibling); } if (rp != p_node) { @@ -514,18 +514,18 @@ class Set { return _insert(p_value); } - void erase(Element *p_element) { + void remove(Element *p_element) { if (!_data._root || !p_element) { return; } - _erase(p_element); + _remove(p_element); if (_data.size_cache == 0 && _data._root) { _data._free_root(); } } - bool erase(const T &p_value) { + bool remove(const T &p_value) { if (!_data._root) { return false; } @@ -535,7 +535,7 @@ class Set { return false; } - _erase(e); + _remove(e); if (_data.size_cache == 0 && _data._root) { _data._free_root(); } diff --git a/core/templates/vector.h b/core/templates/vector.h index dae8874a87bb..fc94bf185f13 100644 --- a/core/templates/vector.h +++ b/core/templates/vector.h @@ -67,11 +67,11 @@ class Vector { _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 erase(const T &p_val) { + void remove_at(int p_index) { _cowdata.remove(p_index); } + void remove(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 520e0b3720c3..e8817c56bbcc 100644 --- a/core/templates/vmap.h +++ b/core/templates/vmap.h @@ -129,7 +129,7 @@ class VMap { return _find_exact(p_val) != -1; } - void erase(const T &p_val) { + void remove(const T &p_val) { int pos = _find_exact(p_val); if (pos < 0) { return; diff --git a/core/templates/vset.h b/core/templates/vset.h index 6665651d4233..e8ba7c7bf932 100644 --- a/core/templates/vset.h +++ b/core/templates/vset.h @@ -114,12 +114,12 @@ class VSet { return _find_exact(p_val) != -1; } - void erase(const T &p_val) { + void remove(const T &p_val) { int pos = _find_exact(p_val); 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 09cf785390b4..31e91ee6e4d6 100644 --- a/core/variant/array.cpp +++ b/core/variant/array.cpp @@ -213,9 +213,9 @@ void Array::fill(const Variant &p_value) { _p->array.fill(p_value); } -void Array::erase(const Variant &p_value) { - ERR_FAIL_COND(!_p->typed.validate(p_value, "erase")); - _p->array.erase(p_value); +void Array::remove(const Variant &p_value) { + ERR_FAIL_COND(!_p->typed.validate(p_value, "remove")); + _p->array.remove(p_value); } Variant Array::front() const { @@ -284,8 +284,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) { @@ -546,7 +546,7 @@ Variant Array::pop_back() { Variant Array::pop_front() { if (!_p->array.is_empty()) { Variant ret = _p->array.get(0); - _p->array.remove(0); + _p->array.remove_at(0); return ret; } return Variant(); diff --git a/core/variant/array.h b/core/variant/array.h index 540dcb1f4e91..f8db789e6c8e 100644 --- a/core/variant/array.h +++ b/core/variant/array.h @@ -73,7 +73,7 @@ class Array { Error resize(int p_new_size); void 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; @@ -92,7 +92,7 @@ class Array { int count(const Variant &p_value) const; bool has(const Variant &p_value) const; - void erase(const Variant &p_value); + void remove(const Variant &p_value); void push_front(const Variant &p_value); Variant pop_back(); diff --git a/core/variant/dictionary.cpp b/core/variant/dictionary.cpp index b2f7c6aa0a23..cca17040a834 100644 --- a/core/variant/dictionary.cpp +++ b/core/variant/dictionary.cpp @@ -138,8 +138,8 @@ bool Dictionary::has_all(const Array &p_keys) const { return true; } -bool Dictionary::erase(const Variant &p_key) { - return _p->variant_map.erase(p_key); +bool Dictionary::remove(const Variant &p_key) { + return _p->variant_map.remove(p_key); } bool Dictionary::operator==(const Dictionary &p_dictionary) const { diff --git a/core/variant/dictionary.h b/core/variant/dictionary.h index 4067ff9fd938..c0942a091ad0 100644 --- a/core/variant/dictionary.h +++ b/core/variant/dictionary.h @@ -66,7 +66,7 @@ class Dictionary { bool has(const Variant &p_key) const; bool has_all(const Array &p_keys) const; - bool erase(const Variant &p_key); + bool remove(const Variant &p_key); bool operator==(const Dictionary &p_dictionary) const; bool operator!=(const Dictionary &p_dictionary) const; diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index 4e45862fd321..69694bc2b3a5 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -1698,7 +1698,7 @@ String Variant::stringify(List &stack) const { } str += "}"; - stack.erase(d.id()); + stack.remove(d.id()); return str; } break; case PACKED_VECTOR2_ARRAY: { @@ -1802,7 +1802,7 @@ String Variant::stringify(List &stack) const { } str += "]"; - stack.erase(arr.id()); + stack.remove(arr.id()); return str; } break; diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 9c7cd23d72f3..400b8b410e68 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1353,7 +1353,7 @@ static void _register_variant_builtin_methods() { bind_method(String, unicode_at, sarray("at"), varray()); bind_method(String, dedent, sarray(), varray()); // FIXME: String needs to be immutable when binding - //bind_method(String, erase, sarray("position", "chars"), varray()); + //bind_method(String, remove, sarray("position", "chars"), varray()); bind_method(String, hash, sarray(), varray()); bind_method(String, md5_text, sarray(), varray()); bind_method(String, sha1_text, sarray(), varray()); @@ -1718,7 +1718,7 @@ static void _register_variant_builtin_methods() { bind_method(Dictionary, clear, sarray(), varray()); bind_method(Dictionary, has, sarray("key"), varray()); bind_method(Dictionary, has_all, sarray("keys"), varray()); - bind_method(Dictionary, erase, sarray("key"), varray()); + bind_method(Dictionary, remove, sarray("key"), varray()); bind_method(Dictionary, hash, sarray(), varray()); bind_method(Dictionary, keys, sarray(), varray()); bind_method(Dictionary, values, sarray(), varray()); @@ -1737,9 +1737,9 @@ 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("index"), varray()); bind_method(Array, fill, sarray("value"), varray()); - bind_method(Array, erase, sarray("value"), varray()); + bind_method(Array, remove, sarray("value"), varray()); bind_method(Array, front, sarray(), varray()); bind_method(Array, back, sarray(), varray()); bind_method(Array, find, sarray("what", "from"), varray(0)); @@ -1770,7 +1770,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()); @@ -1825,7 +1825,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()); @@ -1844,7 +1844,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()); @@ -1863,7 +1863,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()); @@ -1882,7 +1882,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()); @@ -1901,7 +1901,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()); @@ -1920,7 +1920,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()); @@ -1939,7 +1939,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()); @@ -1958,7 +1958,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/doc/classes/Array.xml b/doc/classes/Array.xml index 543ec096c70d..c0f701b047a9 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -226,7 +226,7 @@ If [code]deep[/code] is [code]true[/code], a deep copy is performed: all nested arrays and dictionaries are duplicated and will not be shared with the original array. If [code]false[/code], a shallow copy is made and references to the original nested arrays and dictionaries are kept, so that modifying a sub-array or dictionary in the copy will also impact those referenced in the source array. - + @@ -524,10 +524,10 @@ [/codeblock] - + - + Removes an element from the array by index. If the index does not exist in the array, nothing happens. To remove an element by searching for its value, use [method erase] instead. diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index 2111358ef456..19278e0b519c 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -20,7 +20,7 @@ [b]Note:[/b] the presets list is only for [i]this[/i] color picker. - + diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml index 76855fc19f15..f55d624235e6 100644 --- a/doc/classes/ConfigFile.xml +++ b/doc/classes/ConfigFile.xml @@ -55,7 +55,7 @@ - + @@ -64,7 +64,7 @@ Deletes the specified section along with all the key-value pairs inside. Raises an error if the section does not exist. - + diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 16c4348994b1..1280c46ac548 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -215,7 +215,7 @@ Creates a copy of the dictionary, and returns it. The [code]deep[/code] parameter causes inner dictionaries and arrays to be copied recursively, but does not apply to objects. - + diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index e7322235169b..0aa63d1ece36 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -72,7 +72,7 @@ [/codeblocks] - + diff --git a/doc/classes/IP.xml b/doc/classes/IP.xml index b3ce1abaeb62..85d2e8bca36b 100644 --- a/doc/classes/IP.xml +++ b/doc/classes/IP.xml @@ -18,7 +18,7 @@ Removes all of a [code]hostname[/code]'s cached references. If no [code]hostname[/code] is given, all cached IP addresses are removed. - + diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml index 0fb18d8e81cd..05abf53633d8 100644 --- a/doc/classes/InputMap.xml +++ b/doc/classes/InputMap.xml @@ -21,7 +21,7 @@ Adds an [InputEvent] to an action. This [InputEvent] will trigger the action. - + @@ -32,7 +32,7 @@ Removes an [InputEvent] from an action. - + @@ -84,7 +84,7 @@ An [InputEvent] can then be added to this action with [method action_add_event]. - + diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index 19cfcd7c8780..12468dec51ad 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -136,7 +136,7 @@ Appends a value to the array. - + diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index ab97c9a6956c..1095eaa0c5d4 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -137,7 +137,7 @@ Appends an element at the end of the array. - + diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index ad20801b01e0..cfcb702f42e6 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -137,7 +137,7 @@ Appends an element at the end of the array. - + diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index ff4729082e86..d2bfbfd0c38b 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -137,7 +137,7 @@ Appends a value to the array. - + diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index 195b12b129d4..e963a0f9cf95 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -137,7 +137,7 @@ Appends a value to the array. - + diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index 22458832dad2..64882da2f815 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -137,7 +137,7 @@ Appends a string element at end of the array. - + diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index 6c8791f98845..2c585428e8bb 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -145,7 +145,7 @@ Inserts a [Vector2] at the end. - + diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index 00ded3908280..b75427e31d43 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -144,7 +144,7 @@ Inserts a [Vector3] at the end. - + diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index c33a1424a7d3..adaadf1f310f 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -27,7 +27,7 @@ Removes all bones from this [Polygon2D]. - + diff --git a/doc/classes/Translation.xml b/doc/classes/Translation.xml index d286c6cf0cd8..2c08e829d012 100644 --- a/doc/classes/Translation.xml +++ b/doc/classes/Translation.xml @@ -39,7 +39,7 @@ An additional context could be used to specify the translation context or differentiate polysemic words. - + diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index 0256d83feadb..fb0a08d3a8b0 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -82,7 +82,7 @@ Deselects the given column. - + diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index c69b516f3761..598012ebfdfd 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -147,7 +147,7 @@ void RenderingDeviceVulkan::_free_dependencies(RID p_id) { while (E->get().size()) { free(E->get().front()->get()); } - dependency_map.erase(E); + dependency_map.remove(E); } //reverse dependencies must be unreferenced @@ -158,10 +158,10 @@ void RenderingDeviceVulkan::_free_dependencies(RID p_id) { Map>::Element *G = dependency_map.find(F->get()); ERR_CONTINUE(!G); ERR_CONTINUE(!G->get().has(p_id)); - G->get().erase(p_id); + G->get().remove(p_id); } - reverse_dependency_map.erase(E); + reverse_dependency_map.remove(E); } } @@ -4813,10 +4813,10 @@ void RenderingDeviceVulkan::_descriptor_pool_free(const DescriptorPoolKey &p_key p_pool->usage--; if (p_pool->usage == 0) { vkDestroyDescriptorPool(device, p_pool->pool, nullptr); - descriptor_pools[p_key].erase(p_pool); + descriptor_pools[p_key].remove(p_pool); memdelete(p_pool); if (descriptor_pools[p_key].is_empty()) { - descriptor_pools.erase(p_key); + descriptor_pools.remove(p_key); } } } @@ -7011,7 +7011,7 @@ void RenderingDeviceVulkan::compute_list_bind_uniform_set(ComputeListID p_list, textures_to_sampled[i]->layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; - cl->state.textures_to_sampled_layout.erase(textures_to_sampled[i]); + cl->state.textures_to_sampled_layout.remove(textures_to_sampled[i]); } if (textures_to_sampled[i]->used_in_frame != frames_drawn) { @@ -7514,7 +7514,7 @@ void RenderingDeviceVulkan::_free_internal(RID p_id) { void RenderingDeviceVulkan::free(RID p_id) { _THREAD_SAFE_METHOD_ - _free_dependencies(p_id); //recursively erase dependencies first, to avoid potential API problems + _free_dependencies(p_id); //recursively remove dependencies first, to avoid potential API problems _free_internal(p_id); } @@ -7610,7 +7610,7 @@ void RenderingDeviceVulkan::_finalize_command_bufers() { } void RenderingDeviceVulkan::_begin_frame() { - //erase pending resources + //remove pending resources _free_pending_resources(frame); //create setup command buffer and set as the setup buffer @@ -8249,7 +8249,7 @@ void RenderingDeviceVulkan::finalize() { List::Element *N = E->next(); if (texture_is_shared(E->get())) { free(E->get()); - owned.erase(E->get()); + owned.remove(E->get()); } E = N; } @@ -8288,7 +8288,7 @@ void RenderingDeviceVulkan::finalize() { Map::Element *temp = vertex_formats.front(); memdelete_arr(temp->get().bindings); memdelete_arr(temp->get().attributes); - vertex_formats.erase(temp); + vertex_formats.remove(temp); } for (int i = 0; i < framebuffer_formats.size(); i++) { diff --git a/drivers/vulkan/rendering_device_vulkan.h b/drivers/vulkan/rendering_device_vulkan.h index f4fe9cf95679..9371240e6206 100644 --- a/drivers/vulkan/rendering_device_vulkan.h +++ b/drivers/vulkan/rendering_device_vulkan.h @@ -633,7 +633,7 @@ class RenderingDeviceVulkan : public RenderingDevice { RID_Owner texture_buffer_owner; // This structure contains the descriptor set. They _need_ to be allocated - // for a shader (and will be erased when this shader is erased), but should + // for a shader (and will be removed when this shader is removed), but should // work for other shaders as long as the hash matches. This covers using // them in shader variants. // diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 6ed43b5d3196..e374613af40c 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -1250,7 +1250,7 @@ void VulkanContext::window_destroy(DisplayServer::WindowID p_window_id) { ERR_FAIL_COND(!windows.has(p_window_id)); _clean_up_swap_chain(&windows[p_window_id]); vkDestroySurfaceKHR(inst, windows[p_window_id].surface, nullptr); - windows.erase(p_window_id); + windows.remove(p_window_id); } Error VulkanContext::_clean_up_swap_chain(Window *window) { diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index b0b79ca0698c..481f81394cdb 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -816,7 +816,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("action_edited", action_name, action); diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 63ffab672762..47a8656c5431 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -696,7 +696,7 @@ void AnimationBezierTrackEdit::_gui_input(const Ref &p_event) { if (mb->is_shift_pressed()) { //add to selection if (selection.has(i)) { - selection.erase(i); + selection.remove(i); } else { selection.insert(i); } diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 4196bc89405f..38c72f8a1570 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -2090,7 +2090,7 @@ void AnimationTrackEdit::_notification(int p_what) { } { - //erase + //remove Ref icon = get_theme_icon("Remove", "EditorIcons"); @@ -3141,7 +3141,7 @@ void AnimationTrackEditor::add_track_edit_plugin(const Ref &p_plugin) { - track_edit_plugins.erase(p_plugin); + track_edit_plugins.remove(p_plugin); } void AnimationTrackEditor::set_animation(const Ref &p_anim) { @@ -4738,7 +4738,7 @@ void AnimationTrackEditor::_key_deselected(int p_key, int p_track) { sk.key = p_key; sk.track = p_track; - selection.erase(sk); + selection.remove(sk); for (int i = 0; i < track_edits.size(); i++) { track_edits[i]->update(); diff --git a/editor/audio_stream_preview.cpp b/editor/audio_stream_preview.cpp index 539657afd738..6387cfe9677e 100644 --- a/editor/audio_stream_preview.cpp +++ b/editor/audio_stream_preview.cpp @@ -215,7 +215,7 @@ AudioStreamPreviewGenerator *AudioStreamPreviewGenerator::singleton = nullptr; void AudioStreamPreviewGenerator::_notification(int p_what) { if (p_what == NOTIFICATION_PROCESS) { - List to_erase; + List to_remove; for (Map::Element *E = previews.front(); E; E = E->next()) { if (!E->get().generating.is_set()) { if (E->get().thread) { @@ -224,14 +224,14 @@ void AudioStreamPreviewGenerator::_notification(int p_what) { E->get().thread = nullptr; } if (!ObjectDB::get_instance(E->key())) { //no longer in use, get rid of preview - to_erase.push_back(E->key()); + to_remove.push_back(E->key()); } } } - while (to_erase.front()) { - previews.erase(to_erase.front()->get()); - to_erase.pop_front(); + while (to_remove.front()) { + previews.remove(to_remove.front()->get()); + to_remove.pop_front(); } } } diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index de6407da735c..bd5b988b944c 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(); } diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 968b24893c36..668b7c614d61 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -475,7 +475,7 @@ void CreateDialog::_favorite_toggled() { favorite_list.push_back(name); favorite->set_pressed(true); } else { - favorite_list.erase(name); + favorite_list.remove(name); favorite->set_pressed(false); } @@ -567,7 +567,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/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index ded0ee3aa777..1eccff4e7e46 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -656,7 +656,7 @@ void EditorDebuggerNode::add_debugger_plugin(const Ref