mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-07 10:10:08 +03:00
Use the new string_name_new_with_latin1_chars function to improve StringName construction performance
This commit is contained in:
@@ -130,6 +130,7 @@ GDExtensionInterfaceStringOperatorPlusEqCstr gdextension_interface_string_operat
|
||||
GDExtensionInterfaceStringOperatorPlusEqWcstr gdextension_interface_string_operator_plus_eq_wcstr = nullptr;
|
||||
GDExtensionInterfaceStringOperatorPlusEqC32str gdextension_interface_string_operator_plus_eq_c32str = nullptr;
|
||||
GDExtensionInterfaceStringResize gdextension_interface_string_resize = nullptr;
|
||||
GDExtensionInterfaceStringNameNewWithLatin1Chars gdextension_interface_string_name_new_with_latin1_chars = nullptr;
|
||||
GDExtensionInterfaceXmlParserOpenBuffer gdextension_interface_xml_parser_open_buffer = nullptr;
|
||||
GDExtensionInterfaceFileAccessStoreBuffer gdextension_interface_file_access_store_buffer = nullptr;
|
||||
GDExtensionInterfaceFileAccessGetBuffer gdextension_interface_file_access_get_buffer = nullptr;
|
||||
@@ -347,6 +348,7 @@ GDExtensionBool GDExtensionBinding::init(GDExtensionInterfaceGetProcAddress p_ge
|
||||
LOAD_PROC_ADDRESS(string_operator_plus_eq_wcstr, GDExtensionInterfaceStringOperatorPlusEqWcstr);
|
||||
LOAD_PROC_ADDRESS(string_operator_plus_eq_c32str, GDExtensionInterfaceStringOperatorPlusEqC32str);
|
||||
LOAD_PROC_ADDRESS(string_resize, GDExtensionInterfaceStringResize);
|
||||
LOAD_PROC_ADDRESS(string_name_new_with_latin1_chars, GDExtensionInterfaceStringNameNewWithLatin1Chars);
|
||||
LOAD_PROC_ADDRESS(xml_parser_open_buffer, GDExtensionInterfaceXmlParserOpenBuffer);
|
||||
LOAD_PROC_ADDRESS(file_access_store_buffer, GDExtensionInterfaceFileAccessStoreBuffer);
|
||||
LOAD_PROC_ADDRESS(file_access_get_buffer, GDExtensionInterfaceFileAccessGetBuffer);
|
||||
|
||||
@@ -458,8 +458,9 @@ String operator+(char32_t p_char, const String &p_str) {
|
||||
return String::chr(p_char) + p_str;
|
||||
}
|
||||
|
||||
StringName::StringName(const char *from) :
|
||||
StringName(String(from)) {}
|
||||
StringName::StringName(const char *from, bool p_static) {
|
||||
internal::gdextension_interface_string_name_new_with_latin1_chars(&opaque, from, p_static);
|
||||
}
|
||||
|
||||
StringName::StringName(const wchar_t *from) :
|
||||
StringName(String(from)) {}
|
||||
|
||||
Reference in New Issue
Block a user