Browse Source

fix: blCacheSize calc should use key length

tophf 6 years ago
parent
commit
584a3b53da
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/background/utils/tester.js

+ 1 - 1
src/background/utils/tester.js

@@ -242,7 +242,7 @@ function updateBlacklistCache(key, value) {
   if (blCacheSize > MAX_BL_CACHE_LENGTH) {
     Object.keys(blCache)
     .some((k) => {
-      blCacheSize -= blCache[k].length;
+      blCacheSize -= k.length;
       delete blCache[k];
       // reduce the cache to 75% so that this function doesn't run too often.
       return blCacheSize < MAX_BL_CACHE_LENGTH * 3 / 4;