Skip to content

Commit 37afca2

Browse files
committed
Faster Exporter-> exportString()
1 parent 7eb922f commit 37afca2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Exporter.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,14 @@ private function exportString(string $value): string
318318
}
319319

320320
return "'" .
321-
str_replace(
322-
'<lf>',
323-
"\n",
324-
str_replace(
325-
["\r\n", "\n\r", "\r", "\n"],
326-
['\r\n<lf>', '\n\r<lf>', '\r<lf>', '\n<lf>'],
327-
$value,
328-
),
321+
strtr(
322+
$value,
323+
[
324+
"\r\n" => '\r\n'."\n",
325+
"\n\r" => '\n\r'."\n",
326+
"\r" => '\r'."\n",
327+
"\n" => '\n'."\n"
328+
]
329329
) .
330330
"'";
331331
}

0 commit comments

Comments
 (0)