From 42ad40d10d4c48c1dfcbcbe4f10cd3210478cdfa Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Thu, 8 Aug 2013 13:13:50 -0400 Subject: [PATCH] New: sort the keys in CPDictionary -description. This makes it easier to find an item in a large dictionary. --- Foundation/CPDictionary.j | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Foundation/CPDictionary.j b/Foundation/CPDictionary.j index 330935b9c..b95792f78 100755 --- a/Foundation/CPDictionary.j +++ b/Foundation/CPDictionary.j @@ -723,10 +723,12 @@ var CPDictionaryShowNilDeprecationMessage = YES, - (CPString)description { var string = "@{", - keys = self._keys, + keys = [self allKeys], index = 0, count = self._count; + keys.sort(); + for (; index < count; ++index) { if (index === 0)