From a017c0c4a8f229651a969460114bc327b2aca4b5 Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Fri, 12 Feb 2010 14:09:40 -0800 Subject: [PATCH] Fix for failing CPDictionary tests. Reviewed by me. --- Foundation/CPDictionary.j | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Foundation/CPDictionary.j b/Foundation/CPDictionary.j index df55ea38d..189ad452d 100755 --- a/Foundation/CPDictionary.j +++ b/Foundation/CPDictionary.j @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -//@import "CPRange.j" +@import "CPArray.j" @import "CPObject.j" @import "CPEnumerator.j" @import "CPException.j" + /* @ignore */ @implementation _CPDictionaryValueEnumerator : CPEnumerator { @@ -347,10 +348,13 @@ */ - (BOOL)isEqualToDictionary:(CPDictionary)aDictionary { + var count = [self count]; + if (count !== [aDictionary count]) return NO; var index = count; + while (index--) { var currentKey = _keys[index], @@ -446,12 +450,12 @@ Removes each entry in allKeys from the receiver. @param allKeys an array of keys that will be removed from the dictionary */ -- (void)removeObjectsForKeys:(CPArray)keys +- (void)removeObjectsForKeys:(CPArray)keysForRemoval { - var index = keys.length; + var index = keysForRemoval.length; while (index--) - self.removeValueForKey(keys[index]); + self.removeValueForKey(keysForRemoval[index]); } /*