@@ -253,26 +253,26 @@ addrIn->sin_len = ret.length; #endif components = [IPv4 componentsSeparatedByString: @"."]; - if ([components count] != 4) + if (components.count != 4) @throw [OFInvalidFormatException exception]; addr = 0; for (OFString *component in components) { intmax_t number; - if ([component length] == 0) + if (component.length == 0) @throw [OFInvalidFormatException exception]; if ([component indexOfCharacterFromSet: whitespaceCharacterSet] != OF_NOT_FOUND) @throw [OFInvalidFormatException exception]; - number = [component decimalValue]; + number = component.decimalValue; if (number < 0 || number > UINT8_MAX) @throw [OFInvalidFormatException exception]; addr = (addr << 8) | (number & 0xFF); @@ -292,11 +292,11 @@ if ([component indexOfCharacterFromSet: [OFCharacterSet whitespaceCharacterSet]] != OF_NOT_FOUND) @throw [OFInvalidFormatException exception]; - number = [component hexadecimalValue]; + number = component.hexadecimalValue; if (number > UINT16_MAX) @throw [OFInvalidFormatException exception]; return (uint16_t)number; @@ -325,11 +325,11 @@ if (doubleColon != OF_NOT_FOUND) { OFString *left = [IPv6 substringWithRange: of_range(0, doubleColon)]; OFString *right = [IPv6 substringWithRange: - of_range(doubleColon + 2, [IPv6 length] - doubleColon - 2)]; + of_range(doubleColon + 2, IPv6.length - doubleColon - 2)]; OFArray OF_GENERIC(OFString *) *leftComponents; OFArray OF_GENERIC(OFString *) *rightComponents; size_t i; if ([right hasPrefix: @":"] || [right containsString: @"::"]) @@ -336,11 +336,11 @@ @throw [OFInvalidFormatException exception]; leftComponents = [left componentsSeparatedByString: @":"]; rightComponents = [right componentsSeparatedByString: @":"]; - if ([leftComponents count] + [rightComponents count] > 7) + if (leftComponents.count + rightComponents.count > 7) @throw [OFInvalidFormatException exception]; i = 0; for (OFString *component in leftComponents) { uint16_t number = parseIPv6Component(component); @@ -348,11 +348,11 @@ addrIn6->sin6_addr.s6_addr[i++] = number >> 8; addrIn6->sin6_addr.s6_addr[i++] = number; } i = 16; - for (OFString *component in [rightComponents reversedArray]) { + for (OFString *component in rightComponents.reversedArray) { uint16_t number = parseIPv6Component(component); addrIn6->sin6_addr.s6_addr[--i] = number >> 8; addrIn6->sin6_addr.s6_addr[--i] = number; } @@ -359,18 +359,18 @@ } else { OFArray OF_GENERIC(OFString *) *components = [IPv6 componentsSeparatedByString: @":"]; size_t i; - if ([components count] != 8) + if (components.count != 8) @throw [OFInvalidFormatException exception]; i = 0; for (OFString *component in components) { uint16_t number; - if ([component length] == 0) + if (component.length == 0) @throw [OFInvalidFormatException exception]; number = parseIPv6Component(component); addrIn6->sin6_addr.s6_addr[i++] = number >> 8;