diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-05-06 16:20:20 +0200 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-05-08 12:37:42 +0200 |
commit | a0dbdcc3abbd3e6307c6e68d0e60f8c0fa31d576 (patch) | |
tree | 0b8d0a36f69e28096b06956ebbe2c5e6f7e403a3 /drivers | |
parent | 281fe39929303a8ef12e72ff7999b849bbe0678d (diff) | |
download | redot-engine-a0dbdcc3abbd3e6307c6e68d0e60f8c0fa31d576.tar.gz |
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/alsa/audio_driver_alsa.cpp | 2 | ||||
-rw-r--r-- | drivers/egl/egl_manager.cpp | 2 | ||||
-rw-r--r-- | drivers/pulseaudio/audio_driver_pulseaudio.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp index 764d66c3b8..0c9635339b 100644 --- a/drivers/alsa/audio_driver_alsa.cpp +++ b/drivers/alsa/audio_driver_alsa.cpp @@ -52,7 +52,7 @@ Error AudioDriverALSA::init_output_device() { // If there is a specified output device check that it is really present if (output_device_name != "Default") { PackedStringArray list = get_output_device_list(); - if (list.find(output_device_name) == -1) { + if (!list.has(output_device_name)) { output_device_name = "Default"; new_output_device = "Default"; } diff --git a/drivers/egl/egl_manager.cpp b/drivers/egl/egl_manager.cpp index 4eddfd027b..6073856747 100644 --- a/drivers/egl/egl_manager.cpp +++ b/drivers/egl/egl_manager.cpp @@ -383,7 +383,7 @@ Error EGLManager::initialize() { ERR_FAIL_COND_V(eglGetError() != EGL_SUCCESS, ERR_BUG); const char *platform = _get_platform_extension_name(); - if (extensions_string.split(" ").find(platform) < 0) { + if (!extensions_string.split(" ").has(platform)) { ERR_FAIL_V_MSG(ERR_UNAVAILABLE, vformat("EGL platform extension \"%s\" not found.", platform)); } diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 20382e7f7c..669e6c2aa9 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -183,7 +183,7 @@ Error AudioDriverPulseAudio::init_output_device() { // If there is a specified output device, check that it is really present if (output_device_name != "Default") { PackedStringArray list = get_output_device_list(); - if (list.find(output_device_name) == -1) { + if (!list.has(output_device_name)) { output_device_name = "Default"; new_output_device = "Default"; } @@ -695,7 +695,7 @@ Error AudioDriverPulseAudio::init_input_device() { // If there is a specified input device, check that it is really present if (input_device_name != "Default") { PackedStringArray list = get_input_device_list(); - if (list.find(input_device_name) == -1) { + if (!list.has(input_device_name)) { input_device_name = "Default"; new_input_device = "Default"; } |