Skip to content

Commit

Permalink
Remove unused isPowerOfTwo function from JS compiler. NFC (#23353)
Browse files Browse the repository at this point in the history
Also, add `utf8` to read function to avoid the extra `toString()` call
(which itself defaults to `utf8`).
  • Loading branch information
sbc100 authored Jan 9, 2025
1 parent 0768854 commit 0585506
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/utility.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,9 @@ export function isDecorator(ident) {
return suffixes.some((suffix) => ident.endsWith(suffix));
}

export function isPowerOfTwo(x) {
return x > 0 && (x & (x - 1)) == 0;
}

export function read(filename) {
const absolute = find(filename);
return fs.readFileSync(absolute).toString();
return fs.readFileSync(absolute, 'utf8');
}

function find(filename) {
Expand Down

0 comments on commit 0585506

Please sign in to comment.