summaryrefslogtreecommitdiff
path: root/servers/rendering
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2022-02-03 21:48:38 +0545
committerAnilforextra <anilforextra@gmail.com>2022-02-04 01:28:02 +0545
commitadbe948bda202209b55249198e1837324e703ddb (patch)
treea7f424318e1d944e0564edb6fc55e8eabf266bd0 /servers/rendering
parentbf12719ccabcea9bf9b274f77511e02581678774 (diff)
String: Add contains().
Diffstat (limited to 'servers/rendering')
-rw-r--r--servers/rendering/rendering_device_binds.cpp4
-rw-r--r--servers/rendering/shader_compiler.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/servers/rendering/rendering_device_binds.cpp b/servers/rendering/rendering_device_binds.cpp
index 19cde610ba..e50ac42027 100644
--- a/servers/rendering/rendering_device_binds.cpp
+++ b/servers/rendering/rendering_device_binds.cpp
@@ -99,11 +99,11 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String
if (reading_versions) {
String l = line.strip_edges();
if (!l.is_empty()) {
- if (l.find("=") == -1) {
+ if (!l.contains("=")) {
base_error = "Missing `=` in '" + l + "'. Version syntax is `version = \"<defines with C escaping>\";`.";
break;
}
- if (l.find(";") == -1) {
+ if (!l.contains(";")) {
// We don't require a semicolon per se, but it's needed for clang-format to handle things properly.
base_error = "Missing `;` in '" + l + "'. Version syntax is `version = \"<defines with C escaping>\";`.";
break;
diff --git a/servers/rendering/shader_compiler.cpp b/servers/rendering/shader_compiler.cpp
index 78e81eac0b..69977aaa35 100644
--- a/servers/rendering/shader_compiler.cpp
+++ b/servers/rendering/shader_compiler.cpp
@@ -182,7 +182,7 @@ static String _mkid(const String &p_id) {
static String f2sp0(float p_float) {
String num = rtoss(p_float);
- if (num.find(".") == -1 && num.find("e") == -1) {
+ if (!num.contains(".") && !num.contains("e")) {
num += ".0";
}
return num;