From 39b1f84fc841c167cd6aa7bf8e04d8c8d8d8e798 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Sun, 3 Nov 2013 12:15:08 +0100 Subject: [PATCH] Enum tokens are now sorted This only affects the in-memory representation - sorted tokens are easier to debug. --- Source/Bind/EnumProcessor.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Bind/EnumProcessor.cs b/Source/Bind/EnumProcessor.cs index d08808fb..1e1a1714 100644 --- a/Source/Bind/EnumProcessor.cs +++ b/Source/Bind/EnumProcessor.cs @@ -195,14 +195,16 @@ namespace Bind { foreach (var e in enums.Values) { - var processed_constants = new Dictionary(e.ConstantCollection.Count); + var processed_constants = new SortedDictionary(); foreach (Constant c in e.ConstantCollection.Values) { c.Name = TranslateConstantName(c.Name, false); c.Value = TranslateConstantValue(c.Value); c.Reference = TranslateEnumName(c.Reference); if (!processed_constants.ContainsKey(c.Name)) + { processed_constants.Add(c.Name, c); + } } e.ConstantCollection = processed_constants;