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 /servers/rendering/rendering_device.cpp | |
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 'servers/rendering/rendering_device.cpp')
-rw-r--r-- | servers/rendering/rendering_device.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index 1ee5362f2c..31fc51efaa 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -671,9 +671,9 @@ RID RenderingDevice::texture_create(const TextureFormat &p_format, const Texture TextureFormat format = p_format; if (format.shareable_formats.size()) { - ERR_FAIL_COND_V_MSG(format.shareable_formats.find(format.format) == -1, RID(), + ERR_FAIL_COND_V_MSG(!format.shareable_formats.has(format.format), RID(), "If supplied a list of shareable formats, the current format must be present in the list"); - ERR_FAIL_COND_V_MSG(p_view.format_override != DATA_FORMAT_MAX && format.shareable_formats.find(p_view.format_override) == -1, RID(), + ERR_FAIL_COND_V_MSG(p_view.format_override != DATA_FORMAT_MAX && !format.shareable_formats.has(p_view.format_override), RID(), "If supplied a list of shareable formats, the current view format override must be present in the list"); } @@ -854,7 +854,7 @@ RID RenderingDevice::texture_create_shared(const TextureView &p_view, RID p_with } else { ERR_FAIL_INDEX_V(p_view.format_override, DATA_FORMAT_MAX, RID()); - ERR_FAIL_COND_V_MSG(texture.allowed_shared_formats.find(p_view.format_override) == -1, RID(), + ERR_FAIL_COND_V_MSG(!texture.allowed_shared_formats.has(p_view.format_override), RID(), "Format override is not in the list of allowed shareable formats for original texture."); tv.format = p_view.format_override; } @@ -984,7 +984,7 @@ RID RenderingDevice::texture_create_shared_from_slice(const TextureView &p_view, } else { ERR_FAIL_INDEX_V(p_view.format_override, DATA_FORMAT_MAX, RID()); - ERR_FAIL_COND_V_MSG(texture.allowed_shared_formats.find(p_view.format_override) == -1, RID(), + ERR_FAIL_COND_V_MSG(!texture.allowed_shared_formats.has(p_view.format_override), RID(), "Format override is not in the list of allowed shareable formats for original texture."); tv.format = p_view.format_override; } |