@@ -256,17 +256,15 @@ } @catch (id e) { [self release]; @throw e; } - @try { - return [self initWithObjects: objects - forKeys: keys - count: count]; - } @finally { - objc_autoreleasePoolPop(pool); - } + self = [self initWithObjects: objects forKeys: keys count: count]; + + objc_autoreleasePoolPop(pool); + + return self; } #ifdef __clang__ /* We intentionally don't call into super, so silence the warning. */ # pragma clang diagnostic push @@ -298,20 +296,23 @@ - (instancetype)initWithKey: (id)firstKey arguments: (va_list)arguments { size_t count = 1; id *objects = NULL, *keys = NULL; va_list argumentsCopy; + + if (firstKey == nil) + return [self init]; va_copy(argumentsCopy, arguments); while (va_arg(argumentsCopy, id) != nil) count++; @try { size_t i = 0; id key, object; - if (firstKey == nil || count % 2 != 0) + if (count % 2 != 0) @throw [OFInvalidArgumentException exception]; count /= 2; objects = OFAllocMemory(count, sizeof(id));