@@ -293,16 +293,13 @@ if (oldObject == nil || newObject == nil) @throw [OFInvalidArgumentException exception]; count = self.count; - for (size_t i = 0; i < count; i++) { - if ([[self objectAtIndex: i] isEqual: oldObject]) { + for (size_t i = 0; i < count; i++) + if ([[self objectAtIndex: i] isEqual: oldObject]) [self replaceObjectAtIndex: i withObject: newObject]; - return; - } - } } - (void)replaceObjectIdenticalTo: (id)oldObject withObject: (id)newObject { size_t count; @@ -337,11 +334,13 @@ for (size_t i = 0; i < count; i++) { if ([[self objectAtIndex: i] isEqual: object]) { [self removeObjectAtIndex: i]; - return; + i--; + count--; + continue; } } } - (void)removeObjectIdenticalTo: (id)object @@ -355,11 +354,13 @@ for (size_t i = 0; i < count; i++) { if ([self objectAtIndex: i] == object) { [self removeObjectAtIndex: i]; - return; + i--; + count--; + continue; } } } - (void)removeObjectsInRange: (OFRange)range