Use hash table for GDScript parsing

GDScript now uses hash table for lookup of type lists / functions / keywords, instead of linear String comparisons.
This commit is contained in:
lawnjelly 2023-03-11 20:23:05 +00:00
parent 8e7bb469b5
commit 19f2006ec0
3 changed files with 114 additions and 60 deletions

View file

@ -2095,6 +2095,8 @@ GDScriptWarning::Code GDScriptWarning::get_code_from_name(const String &p_name)
#endif // DEBUG_ENABLED
GDScriptLanguage::GDScriptLanguage() {
GDScriptTokenizer::initialize();
calls = 0;
ERR_FAIL_COND(singleton);
singleton = this;
@ -2139,6 +2141,8 @@ GDScriptLanguage::GDScriptLanguage() {
}
GDScriptLanguage::~GDScriptLanguage() {
GDScriptTokenizer::terminate();
if (_call_stack) {
memdelete_arr(_call_stack);
}