You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Fix String::begins_with when both strings are empty
(cherry picked from commit 3026b566b0)
This commit is contained in:
committed by
Rémi Verschelde
parent
4e3cd10173
commit
02e6c0ab95
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user