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

Appearance settings

Commit a004fc7

Browse filesBrowse 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 parents 9d79a40 + c1df9f2 commit a004fc7
Copy full SHA for a004fc7

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Output/StreamOutput.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function getStream()
7070
*/
7171
protected function doWrite($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
throw new \RuntimeException('Unable to write output.');
7676
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.