From 147e2d558a0d805d7922de59e01323e6a1f694a2 Mon Sep 17 00:00:00 2001 From: Yu-huan Kuo Date: Sun, 6 Oct 2024 23:48:25 +0800 Subject: [PATCH] perf: optimize email address calculating process --- pages/index.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index f06fa3a..7d077cf 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -99,10 +99,8 @@ if (process.client) { const arr = new Uint8Array(mem.buffer, 0, len() satisfies number) - let cnt = 0x0f - for (let i = 0; i < arr.length; i++) { - arr[i] -= i < 0x0a ? ++cnt : cnt++ - (-244 + 0xed) + arr[i] -= i <= 0x09 ? 0x10 + i : 0x16 + i } localStorage.setItem('email', new TextDecoder().decode(arr))