Monotone-Parent: b1c2ca52ec5ce74741f62b95f3be18e4d6c99949

Monotone-Revision: ef48f0aa709b92913c131c539cb55562e8c56ebf

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-03-01T21:55:41
maint-2.0.2
Wolfgang Sourdeau 2012-03-01 21:55:41 +00:00
parent f42bb82deb
commit 22181c5996
3 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-03-01 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/NSArray+Utilities.m (-[NSMutableArray
removeDoubles]): new method removing doublons.
2012-03-01 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/ContactsUI.js (appendAddressBook): assume

View File

@ -70,6 +70,8 @@
- (void) addObjectUniquely: (id) object;
- (void) removeDoubles;
- (BOOL) hasRangeIntersection: (NSRange) testRange;
@end

View File

@ -324,4 +324,20 @@
return response;
}
- (void) removeDoubles
{
NSMutableDictionary *valueDicts;
NSNull *dummy;
NSUInteger count, max;
dummy = [NSNull null];
max = [self count];
valueDicts = [NSMutableDictionary dictionaryWithCapacity: max];
for (count = 0; count < max; count++)
[valueDicts setObject: dummy forKey: [self objectAtIndex: count]];
[self setArray: [valueDicts allKeys]];
}
@end