tedious / JShrink

Javascript Minifier built in PHP
http://www.tedivm.com
BSD 3-Clause "New" or "Revised" License
749 stars 152 forks source link

Remove initialize newline normalization #115

Closed tedivm closed 1 year ago

tedivm commented 1 year ago

The initialize function runs a string replace on three patterns-

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.