diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-18 16:14:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-18 16:14:14 +0200 |
commit | 92f20fd70e6957cd65ccb7837fdc28f9b1e4a315 (patch) | |
tree | 0e1bc221f9883213d7092fc3858788ee14deecf8 /core/string | |
parent | 98b5280d1fe6e6287c564d80a4ae7b61fc7bd4b0 (diff) | |
parent | b6af2a29eb1f96518c89a35a6a50a6309673d9f0 (diff) |
Merge pull request #49659 from LightningAA/string-valid-integer-to-int
Diffstat (limited to 'core/string')
-rw-r--r-- | core/string/ustring.cpp | 6 | ||||
-rw-r--r-- | core/string/ustring.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 019754bc22..16ecd2b985 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -294,7 +294,7 @@ Error String::parse_url(String &r_scheme, String &r_host, int &r_port, String &r // Port if (base.begins_with(":")) { base = base.substr(1, base.length() - 1); - if (!base.is_valid_integer()) { + if (!base.is_valid_int()) { return ERR_INVALID_PARAMETER; } r_port = base.to_int(); @@ -4168,7 +4168,7 @@ String String::trim_suffix(const String &p_suffix) const { return s; } -bool String::is_valid_integer() const { +bool String::is_valid_int() const { int len = length(); if (len == 0) { @@ -4393,7 +4393,7 @@ bool String::is_valid_ip_address() const { } for (int i = 0; i < ip.size(); i++) { String n = ip[i]; - if (!n.is_valid_integer()) { + if (!n.is_valid_int()) { return false; } int val = n.to_int(); diff --git a/core/string/ustring.h b/core/string/ustring.h index 82cd3e1667..ffb354d6e1 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -425,7 +425,7 @@ public: String validate_node_name() const; bool is_valid_identifier() const; - bool is_valid_integer() const; + bool is_valid_int() const; bool is_valid_float() const; bool is_valid_hex_number(bool p_with_prefix) const; bool is_valid_html_color() const; |