From b5b75cad430efe148b1555f126930b73cf33d2e8 Mon Sep 17 00:00:00 2001 From: Nathan Franke Date: Wed, 8 Dec 2021 00:34:17 -0600 Subject: Use OrderedHashMap for enum_values --- modules/gdscript/gdscript_parser.cpp | 8 ++++---- modules/gdscript/gdscript_parser.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 48f58e51fe..5bcfc023c0 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3510,12 +3510,12 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node variable->export_info.hint = PROPERTY_HINT_ENUM; String enum_hint_string; - for (const Map::Element *E = export_type.enum_values.front(); E; E = E->next()) { - enum_hint_string += E->key().operator String().capitalize().xml_escape(); + for (OrderedHashMap::Element E = export_type.enum_values.front(); E; E = E.next()) { + enum_hint_string += E.key().operator String().capitalize().xml_escape(); enum_hint_string += ":"; - enum_hint_string += String::num_int64(E->get()).xml_escape(); + enum_hint_string += String::num_int64(E.value()).xml_escape(); - if (E->next()) { + if (E.next()) { enum_hint_string += ","; } } diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 2f05b4b948..fe185877a5 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -133,7 +133,7 @@ public: ClassNode *class_type = nullptr; MethodInfo method_info; // For callable/signals. - Map enum_values; // For enums. + OrderedHashMap enum_values; // For enums. _FORCE_INLINE_ bool is_set() const { return kind != UNRESOLVED; } _FORCE_INLINE_ bool has_no_type() const { return type_source == UNDETECTED; } -- cgit v1.2.3