@@ -374,12 +374,15 @@ #ifdef OF_HAVE_BLOCKS - (void)replaceObjectsUsingBlock: (of_array_replace_block_t)block { [self enumerateObjectsUsingBlock: ^ (id object, size_t index, bool *stop) { - [self replaceObjectAtIndex: index - withObject: block(object, index, stop)]; + id new = block(object, index); + + if (new != object) + [self replaceObjectAtIndex: index + withObject: new]; }]; } #endif - (void)exchangeObjectAtIndex: (size_t)index1