Skip to content

Commit

Permalink
Update packages/adblocker/src/data-view.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Krzysztof Modras <[email protected]>
  • Loading branch information
seia-soto and chrmod authored Jan 10, 2025
1 parent 47dc63a commit 72e5b0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/adblocker/src/data-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export function sizeOfASCII(str: string): number {
* Return number of bytes needed to serialize `str` UTF8 string.
*/
export function sizeOfUTF8(str: string): number {
const encoded = TEXT_ENCODER.encode(str);
return sizeOfLength(encoded.length) + encoded.length;
const encodedLength = TEXT_ENCODER.encode(str).length;
return encodedLength + sizeOfLength(encodedLength);
}

/**
Expand Down

0 comments on commit 72e5b0d

Please sign in to comment.