@@ -242,13 +242,13 @@ OFObject *container; size_t count; id *buffer; container = [[[OFObject alloc] init] autorelease]; - count = [self count]; + count = self.count; buffer = [container allocMemoryWithSize: sizeof(*buffer) - count: [self count]]; + count: count]; [self getObjects: buffer inRange: of_range(0, count)]; return buffer; @@ -279,19 +279,19 @@ id ret; if ([key hasPrefix: @"@"]) { void *pool = objc_autoreleasePoolPush(); - key = [key substringWithRange: of_range(1, [key length] - 1)]; + key = [key substringWithRange: of_range(1, key.length - 1)]; ret = [[super valueForKey: key] retain]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } - ret = [OFMutableArray arrayWithCapacity: [self count]]; + ret = [OFMutableArray arrayWithCapacity: self.count]; for (id object in self) { id value = [object valueForKey: key]; if (value == nil) @@ -309,11 +309,11 @@ forKey: (OFString *)key { if ([key hasPrefix: @"@"]) { void *pool = objc_autoreleasePoolPush(); - key = [key substringWithRange: of_range(1, [key length] - 1)]; + key = [key substringWithRange: of_range(1, key.length - 1)]; [super setValue: value forKey: key]; objc_autoreleasePoolPop(pool); return; @@ -368,19 +368,19 @@ return ([self indexOfObjectIdenticalTo: object] != OF_NOT_FOUND); } - (id)firstObject { - if ([self count] > 0) + if (self.count > 0) return [self objectAtIndex: 0]; return nil; } - (id)lastObject { - size_t count = [self count]; + size_t count = self.count; if (count > 0) return [self objectAtIndex: count - 1]; return nil; @@ -390,11 +390,11 @@ { OFArray *ret; id *buffer; if (range.length > SIZE_MAX - range.location || - range.location + range.length < [self count]) + range.location + range.length < self.count) @throw [OFOutOfRangeException exception]; if (![self isKindOfClass: [OFMutableArray class]]) return [OFArray_subarray arrayWithArray: self range: range]; @@ -445,14 +445,14 @@ OFMutableString *ret; if (separator == nil) @throw [OFInvalidArgumentException exception]; - if ([self count] == 0) + if (self.count == 0) return @""; - if ([self count] == 1) { + if (self.count == 1) { OFString *component = [[self firstObject] performSelector: selector]; if (component == nil) @throw [OFInvalidArgumentException exception]; @@ -469,12 +469,12 @@ [object performSelector: selector]; if (component == nil) @throw [OFInvalidArgumentException exception]; - if ([component length] > 0) { - if ([ret length] > 0) + if (component.length > 0) { + if (ret.length > 0) [ret appendString: separator]; [ret appendString: component]; } objc_autoreleasePoolPop(pool); @@ -518,13 +518,13 @@ if (![object isKindOfClass: [OFArray class]]) return false; otherArray = object; - count = [self count]; + count = self.count; - if (count != [otherArray count]) + if (count != otherArray.count) return false; for (size_t i = 0; i < count; i++) if (![[self objectAtIndex: i] isEqual: [otherArray objectAtIndex: i]]) @@ -550,11 +550,11 @@ - (OFString *)description { void *pool; OFMutableString *ret; - if ([self count] == 0) + if (self.count == 0) return @"()"; pool = objc_autoreleasePoolPush(); ret = [[self componentsJoinedByString: @",\n"] mutableCopy]; @@ -585,14 +585,14 @@ namespace: OF_SERIALIZATION_NS]; else element = [OFXMLElement elementWithName: @"OFArray" namespace: OF_SERIALIZATION_NS]; - for (id object in self) { + for (id object in self) { void *pool2 = objc_autoreleasePoolPush(); - [element addChild: [object XMLElementBySerializing]]; + [element addChild: object.XMLElementBySerializing]; objc_autoreleasePoolPop(pool2); } [element retain]; @@ -617,11 +617,11 @@ - (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth { OFMutableString *JSON = [OFMutableString stringWithString: @"["]; void *pool = objc_autoreleasePoolPush(); - size_t i, count = [self count]; + size_t i, count = self.count; if (options & OF_JSON_REPRESENTATION_PRETTY) { OFMutableString *indentation = [OFMutableString string]; for (i = 0; i < depth; i++) @@ -677,11 +677,11 @@ OFMutableData *data; size_t i, count; void *pool; data = [OFMutableData data]; - count = [self count]; + count = self.count; if (count <= 15) { uint8_t tmp = 0x90 | ((uint8_t)count & 0xF); [data addItem: &tmp]; } else if (count <= UINT16_MAX) { @@ -709,12 +709,12 @@ OFData *child; i++; child = [object messagePackRepresentation]; - [data addItems: [child items] - count: [child count]]; + [data addItems: child.items + count: child.count]; objc_autoreleasePoolPop(pool2); } assert(i == count); @@ -797,12 +797,12 @@ of_range_t range = of_range(state->state, count); if (range.length > SIZE_MAX - range.location) @throw [OFOutOfRangeException exception]; - if (range.location + range.length > [self count]) - range.length = [self count] - range.location; + if (range.location + range.length > self.count) + range.length = self.count - range.location; [self getObjects: objects inRange: range]; if (range.location + range.length > ULONG_MAX) @@ -873,11 +873,11 @@ #ifdef OF_HAVE_BLOCKS - (OFArray *)mappedArrayUsingBlock: (of_array_map_block_t)block { OFArray *ret; - size_t count = [self count]; + size_t count = self.count; id *tmp = [self allocMemoryWithSize: sizeof(id) count: count]; @try { [self enumerateObjectsUsingBlock: ^ (id object, size_t idx, @@ -895,11 +895,11 @@ } - (OFArray *)filteredArrayUsingBlock: (of_array_filter_block_t)block { OFArray *ret; - size_t count = [self count]; + size_t count = self.count; id *tmp = [self allocMemoryWithSize: sizeof(id) count: count]; @try { __block size_t i = 0; @@ -919,11 +919,11 @@ return ret; } - (id)foldUsingBlock: (of_array_fold_block_t)block { - size_t count = [self count]; + size_t count = self.count; __block id current; if (count == 0) return nil; if (count == 1)