@@ -38,19 +38,17 @@ { return (id)[[OFMutableMapTableDictionary alloc] initWithDictionary: dictionary]; } -- (instancetype)initWithObject: (id)object - forKey: (id)key +- (instancetype)initWithObject: (id)object forKey: (id)key { return (id)[[OFMutableMapTableDictionary alloc] initWithObject: object forKey: key]; } -- (instancetype)initWithObjects: (OFArray *)objects - forKeys: (OFArray *)keys +- (instancetype)initWithObjects: (OFArray *)objects forKeys: (OFArray *)keys { return (id)[[OFMutableMapTableDictionary alloc] initWithObjects: objects forKeys: keys]; } @@ -74,12 +72,11 @@ va_end(arguments); return ret; } -- (instancetype)initWithKey: (id)firstKey - arguments: (va_list)arguments +- (instancetype)initWithKey: (id)firstKey arguments: (va_list)arguments { return (id)[[OFMutableMapTableDictionary alloc] initWithKey: firstKey arguments: arguments]; } @@ -154,22 +151,19 @@ - (instancetype)initWithCapacity: (size_t)capacity { OF_INVALID_INIT_METHOD } -- (void)setObject: (id)object - forKey: (id)key +- (void)setObject: (id)object forKey: (id)key { OF_UNRECOGNIZED_SELECTOR } -- (void)setObject: (id)object - forKeyedSubscript: (id)key +- (void)setObject: (id)object forKeyedSubscript: (id)key { if (object != nil) - [self setObject: object - forKey: key]; + [self setObject: object forKey: key]; else [self removeObjectForKey: key]; } - (void)removeObjectForKey: (id)key @@ -199,30 +193,28 @@ OFEnumerator *objectEnumerator = [dictionary objectEnumerator]; id key, object; while ((key = [keyEnumerator nextObject]) != nil && (object = [objectEnumerator nextObject]) != nil) - [self setObject: object - forKey: key]; + [self setObject: object forKey: key]; objc_autoreleasePoolPop(pool); } #ifdef OF_HAVE_BLOCKS -- (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block +- (void)replaceObjectsUsingBlock: (OFDictionaryReplaceBlock)block { [self enumerateKeysAndObjectsUsingBlock: ^ (id key, id object, bool *stop) { id new = block(key, object); if (new != object) { - [self setObject: block(key, object) - forKey: key]; + [self setObject: block(key, object) forKey: key]; } }]; } #endif - (void)makeImmutable { } @end