From a0dbdcc3abbd3e6307c6e68d0e60f8c0fa31d576 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Mon, 6 May 2024 16:20:20 +0200 Subject: Replace `find` with `contains/has` where applicable * Replaces `find(...) != -1` with `contains` for `String` * Replaces `find(...) == -1` with `!contains` for `String` * Replaces `find(...) != -1` with `has` for containers * Replaces `find(...) == -1` with `!has` for containers --- modules/openxr/action_map/openxr_action_map.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/openxr/action_map/openxr_action_map.cpp') diff --git a/modules/openxr/action_map/openxr_action_map.cpp b/modules/openxr/action_map/openxr_action_map.cpp index ba0e4f6cdd..5430a41d6d 100644 --- a/modules/openxr/action_map/openxr_action_map.cpp +++ b/modules/openxr/action_map/openxr_action_map.cpp @@ -59,7 +59,7 @@ void OpenXRActionMap::set_action_sets(Array p_action_sets) { for (int i = 0; i < p_action_sets.size(); i++) { Ref action_set = p_action_sets[i]; - if (action_set.is_valid() && action_sets.find(action_set) == -1) { + if (action_set.is_valid() && !action_sets.has(action_set)) { action_sets.push_back(action_set); } } @@ -93,7 +93,7 @@ Ref OpenXRActionMap::get_action_set(int p_idx) const { void OpenXRActionMap::add_action_set(Ref p_action_set) { ERR_FAIL_COND(p_action_set.is_null()); - if (action_sets.find(p_action_set) == -1) { + if (!action_sets.has(p_action_set)) { action_sets.push_back(p_action_set); emit_changed(); } @@ -112,7 +112,7 @@ void OpenXRActionMap::set_interaction_profiles(Array p_interaction_profiles) { for (int i = 0; i < p_interaction_profiles.size(); i++) { Ref interaction_profile = p_interaction_profiles[i]; - if (interaction_profile.is_valid() && interaction_profiles.find(interaction_profile) == -1) { + if (interaction_profile.is_valid() && !interaction_profiles.has(interaction_profile)) { interaction_profiles.push_back(interaction_profile); } } @@ -146,7 +146,7 @@ Ref OpenXRActionMap::get_interaction_profile(int p_idx void OpenXRActionMap::add_interaction_profile(Ref p_interaction_profile) { ERR_FAIL_COND(p_interaction_profile.is_null()); - if (interaction_profiles.find(p_interaction_profile) == -1) { + if (!interaction_profiles.has(p_interaction_profile)) { interaction_profiles.push_back(p_interaction_profile); emit_changed(); } -- cgit v1.2.3