Skip to content

Commit d71d76e

Browse files
authored
Simplify internal isPointerType helper. NFC (#24339)
1 parent f224d23 commit d71d76e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parseTools.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ const SIZE_TYPE = POINTER_TYPE;
240240
const POINTER_WASM_TYPE = `i${POINTER_BITS}`;
241241

242242
function isPointerType(type) {
243-
return type[type.length - 1] == '*';
243+
return type.endsWith('*');
244244
}
245245

246246
// Given an expression like (VALUE=VALUE*2,VALUE<10?VALUE:t+1) , this will
@@ -327,7 +327,7 @@ function getNativeTypeSize(type) {
327327
case 'float': return 4;
328328
case 'double': return 8;
329329
default: {
330-
if (type[type.length - 1] === '*') {
330+
if (type.endsWith('*')) {
331331
return POINTER_SIZE;
332332
}
333333
if (type[0] === 'i') {

0 commit comments

Comments
 (0)