@@ -60,22 +60,22 @@ { void *pool = objc_autoreleasePoolPush(); OFString *cookieDomain, *URLHost; size_t i; - if (![[cookie path] hasPrefix: @"/"]) - [cookie setPath: @"/"]; + if (![cookie.path hasPrefix: @"/"]) + cookie.path = @"/"; - if ([cookie isSecure] && ![[URL scheme] isEqual: @"https"]) { + if (cookie.secure && ![URL.scheme isEqual: @"https"]) { objc_autoreleasePoolPop(pool); return; } - cookieDomain = [[cookie domain] lowercaseString]; - [cookie setDomain: cookieDomain]; + cookieDomain = cookie.domain.lowercaseString; + cookie.domain = cookieDomain; - URLHost = [[URL host] lowercaseString]; + URLHost = URL.host.lowercaseString; if (![cookieDomain isEqual: URLHost]) { URLHost = [@"." stringByAppendingString: URLHost]; if (![cookieDomain hasSuffix: URLHost]) { objc_autoreleasePoolPop(pool); @@ -83,13 +83,13 @@ } } i = 0; for (OFHTTPCookie *iter in _cookies) { - if ([[iter name] isEqual: [cookie name]] && - [[iter domain] isEqual: [cookie domain]] && - [[iter path] isEqual: [cookie path]]) { + if ([iter.name isEqual: cookie.name] && + [iter.domain isEqual: cookie.domain] && + [iter.path isEqual: cookie.path]) { [_cookies replaceObjectAtIndex: i withObject: cookie]; objc_autoreleasePoolPop(pool); return; @@ -119,27 +119,27 @@ void *pool; OFDate *expires; OFString *cookieDomain, *URLHost, *cookiePath, *URLPath; bool match; - expires = [cookie expires]; - if (expires != nil && [expires timeIntervalSinceNow] <= 0) + expires = cookie.expires; + if (expires != nil && expires.timeIntervalSinceNow <= 0) continue; - if ([cookie isSecure] && ![[URL scheme] isEqual: @"https"]) + if (cookie.secure && ![URL.scheme isEqual: @"https"]) continue; pool = objc_autoreleasePoolPush(); - cookieDomain = [[cookie domain] lowercaseString]; - URLHost = [[URL host] lowercaseString]; + cookieDomain = cookie.domain.lowercaseString; + URLHost = URL.host.lowercaseString; if ([cookieDomain hasPrefix: @"."]) { if ([URLHost hasSuffix: cookieDomain]) match = true; else { cookieDomain = [cookieDomain substringWithRange: - of_range(1, [cookieDomain length] - 1)]; + of_range(1, cookieDomain.length - 1)]; match = [cookieDomain isEqual: URLHost]; } } else match = [cookieDomain isEqual: URLHost]; @@ -147,12 +147,12 @@ if (!match) { objc_autoreleasePoolPop(pool); continue; } - cookiePath = [cookie path]; - URLPath = [URL path]; + cookiePath = cookie.path; + URLPath = URL.path; if (![cookiePath isEqual: @"/"]) { if ([cookiePath isEqual: URLPath]) match = true; else { if (![cookiePath hasSuffix: @"/"]) @@ -176,18 +176,18 @@ return ret; } - (void)purgeExpiredCookies { - for (size_t i = 0, count = [_cookies count]; i < count; i++) { + for (size_t i = 0, count = _cookies.count; i < count; i++) { OFDate *expires = [[_cookies objectAtIndex: i] expires]; - if (expires != nil && [expires timeIntervalSinceNow] <= 0) { + if (expires != nil && expires.timeIntervalSinceNow <= 0) { [_cookies removeObjectAtIndex: i]; i--; count--; continue; } } } @end