Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita004fc7

Browse files
minor#18932 Improve memory efficiency (Dword123)
This PR was merged into the 2.7 branch.Discussion----------Improve memory efficiency| Q | A| ------------- | ---| Branch? | 2.7| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |This avoids concatenating `$message` and `PHP_EOL` (if necessary) as a new value, greatly improving memory efficiency for large `$message`s.Commits-------c1df9f2 Improve memory efficiency
2 parents9d79a40 +c1df9f2 commita004fc7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/Console/Output/StreamOutput.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function getStream()
7070
*/
7171
protectedfunctiondoWrite($message,$newline)
7272
{
73-
if (false === @fwrite($this->stream,$message.($newline?PHP_EOL :''))) {
73+
if (false === @fwrite($this->stream,$message) ||($newline&& (false === @fwrite($this->stream,PHP_EOL)))) {
7474
// should never happen
7575
thrownew \RuntimeException('Unable to write output.');
7676
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp