Permalink
Browse files

Fixed incorrect calling sequence and incorrect message to NSMutableSt…

…ring.

Changed newEntryIterator: to newEntryIterator and append: to appendString:.
  • Loading branch information...
1 parent 335a429 commit 347b60303198a766a5b36e78eff67392964aad1c Alan Condit committed Apr 23, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 runtime/ObjC/Framework/HashMap.m
@@ -385,7 +385,7 @@ - (id) init:(HashMap *)aHM
if ( self ) {
hm = aHM;
anArray = [[AMutableArray arrayWithCapacity:16] retain];
- HMEntryIterator *it = [hm newEntryIterator:hm];
+ HMEntryIterator *it = [hm newEntryIterator];
while ( [it hasNext] ) {
HMEntry *entry = [it next];
[anArray addObject:entry];
@@ -1544,8 +1544,10 @@ - (NSString *)description
NSString *key = e.key;
id value = e.value;
[sb appendFormat:@"%@=%@", (key == self ? @"[self Map]" : key), (value == self ? @"[self Map]" : value)];
- if ( ![it hasNext] )
- return [sb append:@"}"];
+ if ( ![it hasNext] ) {
+ [sb appendString:@"}"];
+ return sb;
+ }
[sb appendString:@", "];
}
}

0 comments on commit 347b603

Please sign in to comment.