From 09740463a71bec2b3d689f7a039cabfdedf5608c Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 2 Mar 2015 10:54:15 -0500 Subject: [PATCH] code review --- src/js/contentscript-end.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/contentscript-end.js b/src/js/contentscript-end.js index d67be9b22..5efbeb797 100644 --- a/src/js/contentscript-end.js +++ b/src/js/contentscript-end.js @@ -348,7 +348,7 @@ var messager = vAPI.messaging.channel('contentscript-end.js'); // requests to process high-high generics into as few requests as possible. // The gain is *significant* on bloated pages. - var processHighHighGenericsMisses = 0; + var processHighHighGenericsMisses = 8; var processHighHighGenericsTimer = null; var processHighHighGenerics = function() { @@ -359,12 +359,12 @@ var messager = vAPI.messaging.channel('contentscript-end.js'); //var tStart = timer.now(); if ( document.querySelector(highGenerics.hideHigh) === null ) { //console.debug('%f: high-high generic test time', timer.now() - tStart); - processHighHighGenericsMisses += 1; + processHighHighGenericsMisses -= 1; // Too many misses for these nagging highly generic CSS rules, // so we will just skip them from now on. - if ( processHighHighGenericsMisses >= 8 ) { + if ( processHighHighGenericsMisses === 0 ) { injectedSelectors['{{highHighGenerics}}'] = true; - console.debug('high-high generic: clearly not needed...'); + console.debug('high-high generic: apparently not needed...'); } return; }