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

Remove initialize newline normalization #115

Closed
tedivm opened this issue Mar 4, 2023 · 0 comments · Fixed by #117
Closed

Remove initialize newline normalization #115

tedivm opened this issue Mar 4, 2023 · 0 comments · Fixed by #117

Comments

@tedivm
Copy link
Member

tedivm commented Mar 4, 2023

The initialize function runs a string replace on three patterns-

  • \r\n -> \n
  • \r -> \n
  • \**\ -> Empty String

Two of these are meant to normalize newlines, and the third prevents a bug when a multiline comment has absolutely no content to it.

Replacing all three of these will improve performance by eliminating the str_replace call that scans the full javascript input. However, all three components have to be removed to do so- removing just one won't have significant performance benefits as the full scan will still need to occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant