diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-03 22:21:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-03 22:21:24 +0100 |
commit | f8f19b313d62b707467c54d245b9c3e0ad53f34f (patch) | |
tree | 975f9c64fe51c3809c7c3b2eb0cd46d3563d2bd2 /main | |
parent | 025e778020dde6dcee89f5ae1e2a63ccddc24340 (diff) | |
parent | adbe948bda202209b55249198e1837324e703ddb (diff) |
Merge pull request #57562 from AnilBK/string-add-contains
String: Add contains().
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/main/main.cpp b/main/main.cpp index a632059849..f8088cba1c 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -827,7 +827,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (I->next()) { String vm = I->next()->get(); - if (vm.find("x") == -1) { // invalid parameter format + if (!vm.contains("x")) { // invalid parameter format OS::get_singleton()->print("Invalid resolution '%s', it should be e.g. '1280x720'.\n", vm.utf8().get_data()); @@ -858,7 +858,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (I->next()) { String vm = I->next()->get(); - if (vm.find(",") == -1) { // invalid parameter format + if (!vm.contains(",")) { // invalid parameter format OS::get_singleton()->print("Invalid position '%s', it should be e.g. '80,128'.\n", vm.utf8().get_data()); @@ -940,7 +940,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else if (I->get() == "--debug-server") { if (I->next()) { debug_server_uri = I->next()->get(); - if (debug_server_uri.find("://") == -1) { // wrong address + if (!debug_server_uri.contains("://")) { // wrong address OS::get_singleton()->print("Invalid debug server uri. It should be of the form <protocol>://<bind_address>:<port>.\n"); goto error; } @@ -1073,7 +1073,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else if (I->get() == "--remote-debug") { if (I->next()) { debug_uri = I->next()->get(); - if (debug_uri.find("://") == -1) { // wrong address + if (!debug_uri.contains("://")) { // wrong address OS::get_singleton()->print( "Invalid debug host address, it should be of the form <protocol>://<host/IP>:<port>.\n"); goto error; @@ -1130,7 +1130,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (!remotefs.is_empty()) { file_access_network_client = memnew(FileAccessNetworkClient); int port; - if (remotefs.find(":") != -1) { + if (remotefs.contains(":")) { port = remotefs.get_slicec(':', 1).to_int(); remotefs = remotefs.get_slicec(':', 0); } else { |