Skip to content

Commit b6aa819

Browse files
committed
Optimize builtin lookup
1 parent ccfc111 commit b6aa819

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/builtins.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ export const LIST = [
6363
'wait',
6464
]
6565

66+
const SET = new Set(LIST)
67+
6668
export function isBuiltin(word: string): boolean {
67-
return LIST.find(builtin => builtin === word) !== undefined
69+
return SET.has(word)
6870
}
6971

7072
export async function documentation(builtin: string): Promise<string> {

0 commit comments

Comments
 (0)