mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Improve usage of String.split() vs get_slice()
This commit is contained in:
parent
2753d333f6
commit
d61a337a70
17 changed files with 45 additions and 50 deletions
|
|
@ -280,7 +280,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
|
|||
if (p_value.get_type() == Variant::NIL) {
|
||||
props.erase(p_name);
|
||||
if (p_name.operator String().begins_with("autoload/")) {
|
||||
String node_name = p_name.operator String().split("/")[1];
|
||||
String node_name = p_name.operator String().get_slicec('/', 1);
|
||||
if (autoloads.has(node_name)) {
|
||||
remove_autoload(node_name);
|
||||
}
|
||||
|
|
@ -326,7 +326,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
|
|||
props[p_name] = VariantContainer(p_value, last_order++);
|
||||
}
|
||||
if (p_name.operator String().begins_with("autoload/")) {
|
||||
String node_name = p_name.operator String().split("/")[1];
|
||||
String node_name = p_name.operator String().get_slicec('/', 1);
|
||||
AutoloadInfo autoload;
|
||||
autoload.name = node_name;
|
||||
String path = p_value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue