Skip to content

Commit

Permalink
Partially revert 4169340
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Oct 5, 2024
1 parent 5f2ee6c commit 02cba63
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/js/biditrie.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ class BidiTrieContainer {
}

toSelfie() {
const buf32 = this.buf32.slice(0, this.buf32[CHAR1_SLOT] + 3 >>> 2);
const buf32 = this.buf32.subarray(0, this.buf32[CHAR1_SLOT] + 3 >>> 2);
return { buf32, checksum: i32Checksum(buf32) };
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/hntrie.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ class HNTrieContainer {
}

toSelfie() {
const buf32 = this.buf32.slice(0, this.buf32[CHAR1_SLOT] + 3 >>> 2);
const buf32 = this.buf32.subarray(0, this.buf32[CHAR1_SLOT] + 3 >>> 2);
return { buf32, checksum: i32Checksum(buf32) };
}

Expand Down
6 changes: 3 additions & 3 deletions src/js/static-net-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ const filterDataReset = ( ) => {
filterDataWritePtr = 2;
};
const filterDataToSelfie = ( ) =>
filterData.slice(0, filterDataWritePtr);
filterData.subarray(0, filterDataWritePtr);

const filterDataFromSelfie = selfie => {
if ( selfie instanceof Int32Array === false ) { return false; }
Expand Down Expand Up @@ -3193,7 +3193,7 @@ const urlTokenizer = new (class {
}

toSelfie() {
return this.knownTokens.slice();
return this.knownTokens;
}

fromSelfie(selfie) {
Expand Down Expand Up @@ -4779,7 +4779,7 @@ StaticNetFilteringEngine.prototype.toSelfie = function() {
processedFilterCount: this.processedFilterCount,
acceptedCount: this.acceptedCount,
discardedCount: this.discardedCount,
bitsToBucket: new Map(this.bitsToBucket),
bitsToBucket: this.bitsToBucket,
urlTokenizer: urlTokenizer.toSelfie(),
destHNTrieContainer: destHNTrieContainer.toSelfie(),
origHNTrieContainer: origHNTrieContainer.toSelfie(),
Expand Down

0 comments on commit 02cba63

Please sign in to comment.