Skip to content

Commit de0a6a9

Browse files
semenkodiracdeltas
authored andcommitted
Rearrange logic order
The exclusion is much more likely. Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
1 parent a3ed38a commit de0a6a9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

chromium/rules.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,19 @@ function RuleSet(set_name, match_rule, default_state, note) {
3838
RuleSet.prototype = {
3939
apply: function(urispec) {
4040
var returl = null;
41-
// If a rulset has a match_rule and it fails, go no further
42-
if (this.ruleset_match_c && !this.ruleset_match_c.test(urispec)) {
43-
log(VERB, "ruleset_match_c excluded " + urispec);
44-
return null;
45-
}
46-
// Even so, if we're covered by an exclusion, go home
41+
// If we're covered by an exclusion, go home
4742
for(var i = 0; i < this.exclusions.length; ++i) {
4843
if (this.exclusions[i].pattern_c.test(urispec)) {
4944
log(DBUG,"excluded uri " + urispec);
5045
return null;
5146
}
5247
}
48+
// If a rulset has a match_rule and it fails, go no further
49+
if (this.ruleset_match_c && !this.ruleset_match_c.test(urispec)) {
50+
log(VERB, "ruleset_match_c excluded " + urispec);
51+
return null;
52+
}
53+
5354
// Okay, now find the first rule that triggers
5455
for(var i = 0; i < this.rules.length; ++i) {
5556
returl = urispec.replace(this.rules[i].from_c,

0 commit comments

Comments
 (0)