Skip to content

Commit 0585506

Browse files
authored
Remove unused isPowerOfTwo function from JS compiler. NFC (#23353)
Also, add `utf8` to read function to avoid the extra `toString()` call (which itself defaults to `utf8`).
1 parent 0768854 commit 0585506

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/utility.mjs

+1-5
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,9 @@ export function isDecorator(ident) {
225225
return suffixes.some((suffix) => ident.endsWith(suffix));
226226
}
227227

228-
export function isPowerOfTwo(x) {
229-
return x > 0 && (x & (x - 1)) == 0;
230-
}
231-
232228
export function read(filename) {
233229
const absolute = find(filename);
234-
return fs.readFileSync(absolute).toString();
230+
return fs.readFileSync(absolute, 'utf8');
235231
}
236232

237233
function find(filename) {

0 commit comments

Comments
 (0)