Use the new string_name_new_with_latin1_chars function to improve StringName construction performance

This commit is contained in:
David Snopek
2023-10-09 16:59:29 -05:00
parent ef2f63a00c
commit 3d814f9e4a
5 changed files with 62 additions and 11 deletions

View File

@@ -520,7 +520,10 @@ def generate_builtin_class_header(builtin_api, size, used_classes, fully_used_cl
# Special cases.
if class_name == "String" or class_name == "StringName" or class_name == "NodePath":
result.append(f"\t{class_name}(const char *from);")
if class_name == "StringName":
result.append(f"\t{class_name}(const char *from, bool p_static = false);")
else:
result.append(f"\t{class_name}(const char *from);")
result.append(f"\t{class_name}(const wchar_t *from);")
result.append(f"\t{class_name}(const char16_t *from);")
result.append(f"\t{class_name}(const char32_t *from);")