From 3bcb337d9bf2f97ced7486359d02fd9bcba8a8d9 Mon Sep 17 00:00:00 2001 From: navorite Date: Mon, 1 Jan 2024 09:03:14 +0200 Subject: [PATCH] faster --- .../svelte/src/compiler/phases/1-parse/index.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/svelte/src/compiler/phases/1-parse/index.js b/packages/svelte/src/compiler/phases/1-parse/index.js index 233a8d1617..f1ddec9d49 100644 --- a/packages/svelte/src/compiler/phases/1-parse/index.js +++ b/packages/svelte/src/compiler/phases/1-parse/index.js @@ -49,15 +49,14 @@ export class Parser { this.template = template.trimRight(); - const lang_matches = this.template.matchAll(regex_lang_attribute); + let match_lang; - for (const match of lang_matches) { - if (match[0]?.[1] === 's') { - // ensure it starts with '