nodejs / llparse

Generating parsers in LLVM IR
http://llparse.org
Other
584 stars 30 forks source link

Use string concatenation for header building #59

Open RedYetiDev opened 5 months ago

RedYetiDev commented 5 months ago

This PR uses string concatenation to build the header, rather than repeated redefinitions with +=

WellHiIGuess commented 5 months ago

Can't believe no one thought to change this before

RedYetiDev commented 5 months ago

Can't believe no one thought to change this before

Well, for readability reasons, it may have been preferable in the past, but every time += is used, it is a redundant re-assignment of a variable, so by using '...' + '...', I am lowering the re-assignment count.

Technically, template literals could also be used, but for readability reasons, I chose against them