Permalink
Browse files

add/remove urlfilter speedup

for 11456 filters:
2430ms -> 2278ms
  • Loading branch information...
gwarser committed Apr 14, 2012
1 parent 0a71e2b commit 3b69858764095e57513b53aa39e196b234060e9d
Showing with 4 additions and 2 deletions.
  1. +4 −2 scripts/noads-importer.js
@@ -210,17 +210,19 @@ var importer = {
},
removeFilters: function (rules_array) {
+ var block = opera.extension.urlfilter.block;
for (var i = 0, l = rules_array.length; i < l; i++) {
log('url removed on URL filter reload -> ' + rules_array[i]);
- opera.extension.urlfilter.block.remove(rules_array[i]);
+ block.remove(rules_array[i]);
}
},
setFilters: function (rules_raw) {
var filters = (rules_raw === '') ? [] : rules_raw.split('\n');
+ var block = opera.extension.urlfilter.block;
for (var i = 0, l = filters.length; i < l; i++) {
log('url added on URL filter reload -> ' + filters[i]);
- opera.extension.urlfilter.block.add(filters[i]);
+ block.add(filters[i]);
}
return filters;
},

0 comments on commit 3b69858

Please sign in to comment.