Closed Lautenschlager-id closed 4 years ago
This script is never even run. It's just sample source code to be parsed when benchmarking. Why bother optimising it?
Because most, if not all, benchmarks do consider performance - which will usually be worse if not optimized
Like @fstirlitz said, it's only parsed, it's never evaluated or executed so optimizing it really doesn't matter.
Feel free to open up the PR at the project's own repository though https://github.com/stravant/LuaMinify (it's an entirely different parser written in lua instead of js)
It's also possible to use
next, tb
instead ofpairs(tb)
if you're not interested ingetmetatable(tb).__pairs
's behavior