diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-01 21:29:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-01 21:29:33 +0100 |
commit | b5707400ebb3daa346fece54c119a5da70852647 (patch) | |
tree | 05a82f8a1434e4fa380d9e78cd34c3bcb33ecb1e /editor/plugins | |
parent | dc4483a3a74a4cac83fc0387ea4d09066a0a0e1c (diff) | |
parent | fc27636999a15f88b1f3b1d7101d84a67968ba06 (diff) |
Merge pull request #57525 from AnilBK/vector-use-clear-has
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/animation_blend_space_2d_editor.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/animation_state_machine_editor.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/polygon_2d_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index c0029312a7..f9df8db419 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -180,7 +180,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven selected_point = -1; for (int i = 0; i < points.size(); i++) { - if (making_triangle.find(i) != -1) { + if (making_triangle.has(i)) { continue; } diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 94990636da..649fc53b3a 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -755,7 +755,7 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() { //now scroll it to draw state_machine_draw->draw_style_box(sb, nr.node); - if (playing && (blend_from == name || current == name || travel_path.find(name) != -1)) { + if (playing && (blend_from == name || current == name || travel_path.has(name))) { state_machine_draw->draw_style_box(playing_overlay, nr.node); } diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 7a96e6eced..b116f8ff6d 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -473,7 +473,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) { uv_move_current = uv_mode; if (uv_move_current == UV_MODE_CREATE) { if (!uv_create) { - points_prev.resize(0); + points_prev.clear(); Vector2 tuv = mtx.affine_inverse().xform(snap_point(mb->get_position())); points_prev.push_back(tuv); uv_create_to = tuv; @@ -682,7 +682,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) { } polygon_create.clear(); - } else if (polygon_create.find(closest) == -1) { + } else if (!polygon_create.has(closest)) { //add temporarily if not exists polygon_create.push_back(closest); } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 2a8882bbd1..9e46150813 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -3486,7 +3486,7 @@ void ScriptEditor::_open_script_request(const String &p_path) { void ScriptEditor::register_syntax_highlighter(const Ref<EditorSyntaxHighlighter> &p_syntax_highlighter) { ERR_FAIL_COND(p_syntax_highlighter.is_null()); - if (syntax_highlighters.find(p_syntax_highlighter) == -1) { + if (!syntax_highlighters.has(p_syntax_highlighter)) { syntax_highlighters.push_back(p_syntax_highlighter); } } diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index ef6d7b3462..61657397f1 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -1030,7 +1030,7 @@ void VisualShaderEditor::edit(VisualShader *p_visual_shader) { } void VisualShaderEditor::add_plugin(const Ref<VisualShaderNodePlugin> &p_plugin) { - if (plugins.find(p_plugin) != -1) { + if (plugins.has(p_plugin)) { return; } plugins.push_back(p_plugin); |