Skip to content

Commit 4676273

Browse files
committed
Minor performance improvement
1 parent b637183 commit 4676273

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default function trimNewlines(string) {
66
start++;
77
}
88

9-
while (end > 0 && (string[end - 1] === '\r' || string[end - 1] === '\n')) {
9+
while (end > start && (string[end - 1] === '\r' || string[end - 1] === '\n')) {
1010
end--;
1111
}
1212

0 commit comments

Comments
 (0)