flourite icon indicating copy to clipboard operation
flourite copied to clipboard

Optimize the usage of regular expressions

Open aldy505 opened this issue 2 years ago • 2 comments

Some regular expressions that are currently on the /src/language directory are somewhat inefficient.

Take this as an example: https://github.com/teknologi-umum/flourite/blob/32bc6b7bbac2a2cc49fe42ac8412feec7f7500fc/src/languages/clojure.ts#L4-L7

That pattern might be optimized to /^\s*\(ns(\s+)(.*)(\))?$/ to minimize the steps needed to achieve the same result.

I believe there are more patterns like that, that can be optimized.

aldy505 avatar Oct 05 '21 15:10 aldy505