From 8fc2ebe7a151558109d41c960b2da4ed45d331aa Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Thu, 22 Oct 2026 23:49:19 -0500 Subject: [PATCH] refactor: simplify element bounds lookup expressions --- term-native.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/term-native.ts b/term-native.ts index 62f11b3..7f89b9b 100644 --- a/term-native.ts +++ b/term-native.ts @@ -217,14 +217,11 @@ export async function createTermNative( return ids; }, getElementBounds(id: string): BoundingBox | undefined { - let enc = new TextEncoder(); - let bytes = enc.encode(id); + let bytes = new TextEncoder().encode(id); new Uint8Array(memory.buffer).set(bytes, opsBuf); let out = opsBuf + 256; let found = ct.get_element_bounds(opsBuf, bytes.length, out); - if (!found) { - return undefined; - } + if (!found) return undefined; let view = new DataView(memory.buffer); return { x: view.getFloat32(out + BOUNDING_BOX.x, true),