A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/gorhill/uBlock/commit/96dce2221821615022c7197543f1ce0575b8f9eb below:

Increase resolution of known-token lookup table · gorhill/uBlock@96dce22 · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+13

-10

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+13

-10

lines changed Original file line number Diff line number Diff line change

@@ -138,7 +138,7 @@ const µBlock = (function() { // jshint ignore:line

138 138

// Read-only

139 139

systemSettings: {

140 140

compiledMagic: 12, // Increase when compiled format changes

141 -

selfieMagic: 12 // Increase when selfie format changes

141 +

selfieMagic: 13 // Increase when selfie format changes

142 142

},

143 143 144 144

restoreBackupSettings: {

Original file line number Diff line number Diff line change

@@ -2326,7 +2326,6 @@ FilterContainer.prototype.freeze = function() {

2326 2326

const filterDataHolderId = FilterDataHolder.fid;

2327 2327

const redirectTypeValue = typeNameToTypeValue.redirect;

2328 2328

const unserialize = µb.CompiledLineIO.unserialize;

2329 -

const knownTokens = this.urlTokenizer.knownTokens;

2330 2329 2331 2330

for ( const line of this.goodFilters ) {

2332 2331

if ( this.badFilters.has(line) ) {

@@ -2358,7 +2357,7 @@ FilterContainer.prototype.freeze = function() {

2358 2357

entry.next = bucket;

2359 2358

}

2360 2359

this.dataFilters.set(tokenHash, entry);

2361 -

knownTokens[tokenHash & 0xFFFF] = 1;

2360 +

this.urlTokenizer.addKnownToken(tokenHash);

2362 2361

continue;

2363 2362

}

2364 2363

@@ -2405,7 +2404,7 @@ FilterContainer.prototype.freeze = function() {

2405 2404

continue;

2406 2405

}

2407 2406 2408 -

knownTokens[tokenHash & 0xFFFF] = 1;

2407 +

this.urlTokenizer.addKnownToken(tokenHash);

2409 2408 2410 2409

if ( entry === undefined ) {

2411 2410

bucket.set(tokenHash, filterFromCompiledData(fdata));

Original file line number Diff line number Diff line change

@@ -81,11 +81,15 @@

81 81 82 82

resetKnownTokens() {

83 83

this.knownTokens.fill(0);

84 -

this.knownTokens[this.dotTokenHash & 0xFFFF] = 1;

85 -

this.knownTokens[this.anyTokenHash & 0xFFFF] = 1;

86 -

this.knownTokens[this.anyHTTPSTokenHash & 0xFFFF] = 1;

87 -

this.knownTokens[this.anyHTTPTokenHash & 0xFFFF] = 1;

88 -

this.knownTokens[this.noTokenHash & 0xFFFF] = 1;

84 +

this.addKnownToken(this.dotTokenHash);

85 +

this.addKnownToken(this.anyTokenHash);

86 +

this.addKnownToken(this.anyHTTPSTokenHash);

87 +

this.addKnownToken(this.anyHTTPTokenHash);

88 +

this.addKnownToken(this.noTokenHash);

89 +

}

90 + 91 +

addKnownToken(th) {

92 +

this.knownTokens[th & 0xFFFF ^ th >>> 16] = 1;

89 93

}

90 94 91 95

// Tokenize on demand.

@@ -172,7 +176,7 @@

172 176

th = th * 64 + v;

173 177

n += 1;

174 178

}

175 -

if ( knownTokens[th & 0xFFFF] !== 0 ) {

179 +

if ( knownTokens[th & 0xFFFF ^ th >>> 16] !== 0 ) {

176 180

tokens[j+0] = th;

177 181

tokens[j+1] = ti;

178 182

j += 2;

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4