From f056cb8ebcc7c18a112255ac784e137c31c32ce3 Mon Sep 17 00:00:00 2001 From: kobewi Date: Sat, 22 Jan 2022 02:15:41 +0100 Subject: [PATCH] Don't sort printed Dictionary --- core/variant/variant.cpp | 2 -- .../tests/scripts/parser/features/dictionary_lua_style.out | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index 0f981d0c9e4..38610c4f292 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -1692,8 +1692,6 @@ String Variant::stringify(int recursion_count) const { pairs.push_back(sp); } - pairs.sort(); - for (int i = 0; i < pairs.size(); i++) { if (i > 0) { str += ", "; diff --git a/modules/gdscript/tests/scripts/parser/features/dictionary_lua_style.out b/modules/gdscript/tests/scripts/parser/features/dictionary_lua_style.out index 447d7e223cd..5b0ea9df43a 100644 --- a/modules/gdscript/tests/scripts/parser/features/dictionary_lua_style.out +++ b/modules/gdscript/tests/scripts/parser/features/dictionary_lua_style.out @@ -1,2 +1,2 @@ GDTEST_OK -{2:4, a:1, b:2, with spaces:3} +{a:1, b:2, with spaces:3, 2:4}