mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix String::begins_with when both strings are empty
This commit is contained in:
parent
7d80635fce
commit
3026b566b0
2 changed files with 42 additions and 27 deletions
|
@ -3329,10 +3329,14 @@ bool String::begins_with(const String &p_string) const {
|
|||
|
||||
bool String::begins_with(const char *p_string) const {
|
||||
int l = length();
|
||||
if (l == 0 || !p_string) {
|
||||
if (!p_string) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (l == 0) {
|
||||
return *p_string == 0;
|
||||
}
|
||||
|
||||
const char32_t *str = &operator[](0);
|
||||
int i = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue