Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use string concatenation for header building #59

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

RedYetiDev
Copy link
Member

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

@WellHiIGuess
Copy link

Can't believe no one thought to change this before

@RedYetiDev
Copy link
Member Author

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

Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for the intermediary defineGuard variable

src/compiler/header-builder.ts Outdated Show resolved Hide resolved
src/compiler/header-builder.ts Outdated Show resolved Hide resolved
Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com>
@RedYetiDev RedYetiDev requested a review from Uzlopak August 7, 2024 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants