Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -749,16 +749,16 @@ } - (OFDictionary*)mappedDictionaryUsingBlock: (of_dictionary_map_block_t)block { OFMutableDictionary *new = [OFMutableDictionary dictionary]; - size_t i; - for (i = 0; i < size; i++) - if (data[i] != NULL && data[i] != DELETED) - [new setObject: block(data[i]->key, data[i]->object) - forKey: data[i]->key]; + [self enumerateKeysAndObjectsUsingBlock: ^ (id key, id object, + BOOL *stop) { + [new setObject: block(key, object) + forKey: key]; + }]; /* * Class swizzle the dictionary to be immutable. We declared the return * type to be OFDictionary*, so it can't be modified anyway. But not * swizzling it would create a real copy each time -[copy] is called. @@ -769,17 +769,17 @@ - (OFDictionary*)filteredDictionaryUsingBlock: (of_dictionary_filter_block_t)block { OFMutableDictionary *new = [OFMutableDictionary dictionary]; - size_t i; - for (i = 0; i < size; i++) - if (data[i] != NULL && data[i] != DELETED) - if (block(data[i]->key, data[i]->object)) - [new setObject: data[i]->object - forKey: data[i]->key]; + [self enumerateKeysAndObjectsUsingBlock: ^ (id key, id object, + BOOL *stop) { + if (block(key, object)) + [new setObject: object + forKey: key]; + }]; /* * Class swizzle the dictionary to be immutable. We declared the return * type to be OFDictionary*, so it can't be modified anyway. But not * swizzling it would create a real copy each time -[copy] is called.