mirror of
https://github.com/godotengine/godot
synced 2024-09-05 22:30:46 +00:00
Fix usage of String.left()
This commit is contained in:
parent
8c2beeea90
commit
ea9660e1cf
|
@ -939,7 +939,7 @@ const char32_t *String::get_data() const {
|
|||
}
|
||||
|
||||
void String::erase(int p_pos, int p_chars) {
|
||||
*this = left(p_pos) + substr(p_pos + p_chars, length() - ((p_pos + p_chars)));
|
||||
*this = left(MAX(p_pos, 0)) + substr(p_pos + p_chars, length() - ((p_pos + p_chars)));
|
||||
}
|
||||
|
||||
String String::capitalize() const {
|
||||
|
|
|
@ -1824,7 +1824,13 @@ void EditorInspector::update_tree() {
|
|||
}
|
||||
}
|
||||
|
||||
String path = basename.left(basename.rfind("/"));
|
||||
String path;
|
||||
{
|
||||
int idx = basename.rfind("/");
|
||||
if (idx > -1) {
|
||||
path = basename.left(idx);
|
||||
}
|
||||
}
|
||||
|
||||
if (use_filter && filter != "") {
|
||||
String cat = path;
|
||||
|
|
Loading…
Reference in a new issue