This commit is contained in:
gorhill 2016-03-17 13:56:21 -04:00
parent 47b0ea83f7
commit 36e681e39b
4 changed files with 18 additions and 16 deletions

View File

@ -94,7 +94,7 @@ return {
// read-only
systemSettings: {
compiledMagic: 'nytangedtvcz',
selfieMagic: 'xtsldiywhvgc'
selfieMagic: 'emzolxctioww'
},
restoreBackupSettings: {

View File

@ -634,7 +634,7 @@ FilterContainer.prototype.reset = function() {
this.µburi = µb.URI;
this.frozen = false;
this.acceptedCount = 0;
this.duplicateCount = 0;
this.discardedCount = 0;
this.duplicateBuster = {};
this.selectorCache = {};
@ -921,7 +921,7 @@ FilterContainer.prototype.fromCompiledContent = function(text, lineBeg, skip) {
this.acceptedCount += 1;
if ( this.duplicateBuster.hasOwnProperty(line) ) {
this.duplicateCount += 1;
this.discardedCount += 1;
continue;
}
this.duplicateBuster[line] = true;
@ -1029,6 +1029,8 @@ FilterContainer.prototype.skipCompiledContent = function(text, lineBeg) {
if ( lineEnd === -1 ) {
lineEnd = textEnd;
}
this.acceptedCount += 1;
this.discardedCount += 1;
lineBeg = lineEnd + 1;
}
return textEnd;
@ -1187,7 +1189,7 @@ FilterContainer.prototype.toSelfie = function() {
return {
acceptedCount: this.acceptedCount,
duplicateCount: this.duplicateCount,
discardedCount: this.discardedCount,
hostnameSpecificFilters: selfieFromDict(this.hostnameFilters),
entitySpecificFilters: this.entityFilters,
lowGenericHide: selfieFromDict(this.lowGenericHide),
@ -1251,7 +1253,7 @@ FilterContainer.prototype.fromSelfie = function(selfie) {
};
this.acceptedCount = selfie.acceptedCount;
this.duplicateCount = selfie.duplicateCount;
this.discardedCount = selfie.discardedCount;
this.hostnameFilters = dictFromSelfie(selfie.hostnameSpecificFilters);
this.entityFilters = selfie.entitySpecificFilters;
this.lowGenericHide = dictFromSelfie(selfie.lowGenericHide);
@ -1496,7 +1498,7 @@ FilterContainer.prototype.retrieveDomainSelectors = function(request) {
/******************************************************************************/
FilterContainer.prototype.getFilterCount = function() {
return this.acceptedCount - this.duplicateCount;
return this.acceptedCount - this.discardedCount;
};
/******************************************************************************/

View File

@ -1686,7 +1686,7 @@ FilterContainer.prototype.reset = function() {
this.rejectedCount = 0;
this.allowFilterCount = 0;
this.blockFilterCount = 0;
this.duplicateCount = 0;
this.discardedCount = 0;
this.duplicateBuster = {};
this.categories = Object.create(null);
this.filterParser.reset();
@ -1782,7 +1782,7 @@ FilterContainer.prototype.toSelfie = function() {
rejectedCount: this.rejectedCount,
allowFilterCount: this.allowFilterCount,
blockFilterCount: this.blockFilterCount,
duplicateCount: this.duplicateCount,
discardedCount: this.discardedCount,
categories: categoriesToSelfie(this.categories)
};
};
@ -1796,7 +1796,7 @@ FilterContainer.prototype.fromSelfie = function(selfie) {
this.rejectedCount = selfie.rejectedCount;
this.allowFilterCount = selfie.allowFilterCount;
this.blockFilterCount = selfie.blockFilterCount;
this.duplicateCount = selfie.duplicateCount;
this.discardedCount = selfie.discardedCount;
var catKey, tokenKey;
var dict = this.categories, subdict;
@ -2086,13 +2086,13 @@ FilterContainer.prototype.fromCompiledContent = function(text, lineBeg) {
entry = bucket['.'] = new FilterHostnameDict();
}
if ( entry.add(fields[2]) === false ) {
this.duplicateCount += 1;
this.discardedCount += 1;
}
continue;
}
if ( this.duplicateBuster.hasOwnProperty(line) ) {
this.duplicateCount += 1;
this.discardedCount += 1;
continue;
}
this.duplicateBuster[line] = true;
@ -2569,7 +2569,7 @@ FilterContainer.prototype.toResultString = function(verbose) {
/******************************************************************************/
FilterContainer.prototype.getFilterCount = function() {
return this.acceptedCount - this.duplicateCount;
return this.acceptedCount - this.discardedCount;
};
/******************************************************************************/

View File

@ -180,11 +180,11 @@
var snfe = µb.staticNetFilteringEngine;
var cfe = µb.cosmeticFilteringEngine;
var acceptedCount = snfe.acceptedCount + cfe.acceptedCount;
var duplicateCount = snfe.duplicateCount + cfe.duplicateCount;
var discardedCount = snfe.discardedCount + cfe.discardedCount;
µb.applyCompiledFilters(compiledFilters, true);
var entry = µb.remoteBlacklists[µb.userFiltersPath];
var deltaEntryCount = snfe.acceptedCount + cfe.acceptedCount - acceptedCount;
var deltaEntryUsedCount = deltaEntryCount - (snfe.duplicateCount + cfe.duplicateCount - duplicateCount);
var deltaEntryUsedCount = deltaEntryCount - (snfe.discardedCount + cfe.discardedCount - discardedCount);
entry.entryCount += deltaEntryCount;
entry.entryUsedCount += deltaEntryUsedCount;
vAPI.storage.set({ 'remoteBlacklists': µb.remoteBlacklists });
@ -417,12 +417,12 @@
var snfe = µb.staticNetFilteringEngine;
var cfe = µb.cosmeticFilteringEngine;
var acceptedCount = snfe.acceptedCount + cfe.acceptedCount;
var duplicateCount = snfe.duplicateCount + cfe.duplicateCount;
var discardedCount = snfe.discardedCount + cfe.discardedCount;
µb.applyCompiledFilters(compiled, path === µb.userFiltersPath);
if ( µb.remoteBlacklists.hasOwnProperty(path) ) {
var entry = µb.remoteBlacklists[path];
entry.entryCount = snfe.acceptedCount + cfe.acceptedCount - acceptedCount;
entry.entryUsedCount = entry.entryCount - (snfe.duplicateCount + cfe.duplicateCount - duplicateCount);
entry.entryUsedCount = entry.entryCount - (snfe.discardedCount + cfe.discardedCount - discardedCount);
}
};