summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-04 01:38:01 +0200
committerGitHub <noreply@github.com>2020-07-04 01:38:01 +0200
commitc020eea184b84ec9193f2bec5265bd72f4e86d24 (patch)
tree3b1184fee57c0f0c038030808b8264021523024a /modules
parent79b0a9ddfc41c5b9fe3bc903cab1001aefcedde2 (diff)
parent929b98d24b53789b3e3fbbae90aed0fe0e72b409 (diff)
Merge pull request #40092 from hinlopen/remove-find-last
Remove String::find_last (same as rfind)
Diffstat (limited to 'modules')
-rw-r--r--modules/gdnative/gdnative/string.cpp7
-rw-r--r--modules/gdnative/gdnative_api.json8
-rw-r--r--modules/gdnative/include/gdnative/string.h1
-rw-r--r--modules/websocket/websocket_client.cpp2
4 files changed, 1 insertions, 17 deletions
diff --git a/modules/gdnative/gdnative/string.cpp b/modules/gdnative/gdnative/string.cpp
index f89f647aca..8b0c7474e8 100644
--- a/modules/gdnative/gdnative/string.cpp
+++ b/modules/gdnative/gdnative/string.cpp
@@ -277,13 +277,6 @@ godot_int GDAPI godot_string_findn_from(const godot_string *p_self, godot_string
return self->findn(*what, p_from);
}
-godot_int GDAPI godot_string_find_last(const godot_string *p_self, godot_string p_what) {
- const String *self = (const String *)p_self;
- String *what = (String *)&p_what;
-
- return self->find_last(*what);
-}
-
godot_string GDAPI godot_string_format(const godot_string *p_self, const godot_variant *p_values) {
const String *self = (const String *)p_self;
const Variant *values = (const Variant *)p_values;
diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json
index ccd8d2041c..1284ebbd66 100644
--- a/modules/gdnative/gdnative_api.json
+++ b/modules/gdnative/gdnative_api.json
@@ -3825,14 +3825,6 @@
]
},
{
- "name": "godot_string_find_last",
- "return_type": "godot_int",
- "arguments": [
- ["const godot_string *", "p_self"],
- ["godot_string", "p_what"]
- ]
- },
- {
"name": "godot_string_format",
"return_type": "godot_string",
"arguments": [
diff --git a/modules/gdnative/include/gdnative/string.h b/modules/gdnative/include/gdnative/string.h
index 608978db76..dfd4fcab89 100644
--- a/modules/gdnative/include/gdnative/string.h
+++ b/modules/gdnative/include/gdnative/string.h
@@ -111,7 +111,6 @@ godot_int GDAPI godot_string_findmk_from(const godot_string *p_self, const godot
godot_int GDAPI godot_string_findmk_from_in_place(const godot_string *p_self, const godot_array *p_keys, godot_int p_from, godot_int *r_key);
godot_int GDAPI godot_string_findn(const godot_string *p_self, godot_string p_what);
godot_int GDAPI godot_string_findn_from(const godot_string *p_self, godot_string p_what, godot_int p_from);
-godot_int GDAPI godot_string_find_last(const godot_string *p_self, godot_string p_what);
godot_string GDAPI godot_string_format(const godot_string *p_self, const godot_variant *p_values);
godot_string GDAPI godot_string_format_with_custom_placeholder(const godot_string *p_self, const godot_variant *p_values, const char *p_placeholder);
godot_string GDAPI godot_string_hex_encode_buffer(const uint8_t *p_buffer, godot_int p_len);
diff --git a/modules/websocket/websocket_client.cpp b/modules/websocket/websocket_client.cpp
index 3900180739..8feaa9af5a 100644
--- a/modules/websocket/websocket_client.cpp
+++ b/modules/websocket/websocket_client.cpp
@@ -66,7 +66,7 @@ Error WebSocketClient::connect_to_url(String p_url, const Vector<String> p_proto
}
// Port
- p_len = host.find_last(":");
+ p_len = host.rfind(":");
if (p_len != -1 && p_len == host.find(":")) {
port = host.substr(p_len, host.length() - p_len).to_int();
host = host.substr(0, p_len);