@@ -79,11 +79,11 @@ OFMutableString *mutableString; if (![string hasPrefix: @"\""] || ![string hasSuffix: @"\""]) return string; - string = [string substringWithRange: of_range(1, [string length] - 2)]; + string = [string substringWithRange: of_range(1, string.length - 2)]; mutableString = [[string mutableCopy] autorelease]; [mutableString replaceOccurrencesOfString: @"\\f" withString: @"\f"]; [mutableString replaceOccurrencesOfString: @"\\r" @@ -161,14 +161,14 @@ if ((pos = [line rangeOfString: @"="].location) == OF_NOT_FOUND) @throw [OFInvalidFormatException exception]; key = [line substringWithRange: of_range(0, pos)]; value = [line substringWithRange: - of_range(pos + 1, [line length] - pos - 1)]; + of_range(pos + 1, line.length - pos - 1)]; - key = [key stringByDeletingEnclosingWhitespaces]; - value = [value stringByDeletingEnclosingWhitespaces]; + key = key.stringByDeletingEnclosingWhitespaces; + value = value.stringByDeletingEnclosingWhitespaces; key = unescapeString(key); value = unescapeString(value); pair->_key = [key copy]; @@ -217,13 +217,13 @@ defaultValue: nil]; intmax_t ret; if (value != nil) { if ([value hasPrefix: @"0x"] || [value hasPrefix: @"$"]) - ret = [value hexadecimalValue]; + ret = value.hexadecimalValue; else - ret = [value decimalValue]; + ret = value.decimalValue; } else ret = defaultValue; objc_autoreleasePoolPop(pool); @@ -260,11 +260,11 @@ OFString *value = [self stringForKey: key defaultValue: nil]; float ret; if (value != nil) - ret = [value floatValue]; + ret = value.floatValue; else ret = defaultValue; objc_autoreleasePoolPop(pool); @@ -278,11 +278,11 @@ OFString *value = [self stringForKey: key defaultValue: nil]; double ret; if (value != nil) - ret = [value doubleValue]; + ret = value.doubleValue; else ret = defaultValue; objc_autoreleasePoolPop(pool); @@ -401,18 +401,18 @@ OFMutableArray *pairs; id const *lines; size_t count; bool replaced; - if ([array count] == 0) { + if (array.count == 0) { [self removeValueForKey: key]; return; } pool = objc_autoreleasePoolPush(); - pairs = [OFMutableArray arrayWithCapacity: [array count]]; + pairs = [OFMutableArray arrayWithCapacity: array.count]; for (id object in array) { OFINICategory_Pair *pair; if (![object isKindOfClass: [OFString class]]) @@ -423,12 +423,12 @@ pair->_value = [object copy]; [pairs addObject: pair]; } - lines = [_lines objects]; - count = [_lines count]; + lines = _lines.objects; + count = _lines.count; replaced = false; for (size_t i = 0; i < count; i++) { OFINICategory_Pair *pair; @@ -444,16 +444,16 @@ [_lines insertObjectsFromArray: pairs atIndex: i]; replaced = true; /* Continue after inserted pairs */ - i += [array count] - 1; + i += array.count - 1; } else i--; /* Continue at same position */ - lines = [_lines objects]; - count = [_lines count]; + lines = _lines.objects; + count = _lines.count; continue; } } @@ -464,12 +464,12 @@ } - (void)removeValueForKey: (OFString *)key { void *pool = objc_autoreleasePoolPush(); - id const *lines = [_lines objects]; - size_t count = [_lines count]; + id const *lines = _lines.objects; + size_t count = _lines.count; for (size_t i = 0; i < count; i++) { OFINICategory_Pair *pair; if (![lines[i] isKindOfClass: [OFINICategory_Pair class]]) @@ -478,12 +478,12 @@ pair = lines[i]; if ([pair->_key isEqual: key]) { [_lines removeObjectAtIndex: i]; - lines = [_lines objects]; - count = [_lines count]; + lines = _lines.objects; + count = _lines.count; i--; /* Continue at same position */ continue; } } @@ -493,11 +493,11 @@ - (bool)of_writeToStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding first: (bool)first { - if ([_lines count] == 0) + if (_lines.count == 0) return false; if (first) [stream writeFormat: @"[%@]\r\n", _name]; else