Skip to content

Commit e524a85

Browse files
semenkodiracdeltas
authored andcommitted
Rearrange cookie test loop to return earlier
For some reason, we were repeatedly testing that dozens of times... Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
1 parent 0a6c2ae commit e524a85

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

chromium/rules.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,14 @@ RuleSets.prototype = {
240240
while (hostname.charAt(0) == ".")
241241
hostname = hostname.slice(1);
242242

243+
if (!knownHttps && !this.safeToSecureCookie(hostname)) {
244+
return null;
245+
}
246+
243247
var rs = this.potentiallyApplicableRulesets(hostname);
244248
for (var i = 0; i < rs.length; ++i) {
245249
var ruleset = rs[i];
246250
if (ruleset.active) {
247-
if (!knownHttps && !this.safeToSecureCookie(hostname))
248-
continue;
249251
for (var j = 0; j < ruleset.cookierules.length; j++) {
250252
var cr = ruleset.cookierules[j];
251253
if (cr.host_c.test(cookie.domain) && cr.name_c.test(cookie.name)) {

0 commit comments

Comments
 (0)