string matching is cheaper than regex matching so do it first

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1622753 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2014-09-05 18:19:55 +00:00
parent 9e83772d35
commit 3bb9aa5099
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ public class PublicSuffixDomainFilter implements CommonCookieAttributeHandler {
@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
final String domain = cookie.getDomain();
if (matcher.matches(domain) && !domain.equalsIgnoreCase("localhost")) {
if (!domain.equalsIgnoreCase("localhost") && matcher.matches(domain)) {
return false;
} else {
return handler.match(cookie, origin);