Skip to content

Commit 76de700

Browse files
committed
bug symfony#13347 [Console] Helper\TableHelper->addRow optimization (boekkooi)
This PR was merged into the 2.3 branch. Discussion ---------- [Console] Helper\TableHelper->addRow optimization | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#13322 | License | MIT | Doc PR | - Commits ------- 9ea59ac [Console] Helper\Table->addRow optimization
2 parents 55b8939 + 9ea59ac commit 76de700

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/Console/Helper/TableHelper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ public function addRow(array $row)
143143
{
144144
$this->rows[] = array_values($row);
145145

146-
$keys = array_keys($this->rows);
147-
$rowKey = array_pop($keys);
146+
end($this->rows);
147+
$rowKey = key($this->rows);
148+
reset($this->rows);
148149

149150
foreach ($row as $key => $cellValue) {
150151
if (!strstr($cellValue, "\n")) {

0 commit comments

Comments
 (0)