1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Improve usage of String.split() vs get_slice()

This commit is contained in:
kobewi
2023-09-27 22:37:24 +02:00
parent 2753d333f6
commit d61a337a70
17 changed files with 45 additions and 50 deletions

View File

@@ -1756,8 +1756,7 @@ void Input::parse_mapping(const String &p_mapping) {
void Input::add_joy_mapping(const String &p_mapping, bool p_update_existing) {
parse_mapping(p_mapping);
if (p_update_existing) {
Vector<String> entry = p_mapping.split(",");
const String &uid = entry[0];
const String uid = p_mapping.get_slicec(',', 0);
for (KeyValue<int, Joypad> &E : joy_names) {
Joypad &joy = E.value;
if (joy.uid == uid) {