bug #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 | #13322
| License       | MIT
| Doc PR        | -

Commits
-------

9ea59ac [Console] Helper\Table->addRow optimization
This commit is contained in:
Fabien Potencier 2015-01-10 18:05:09 +01:00
commit 76de7006d5
1 changed files with 3 additions and 2 deletions

View File

@ -143,8 +143,9 @@ class TableHelper extends Helper
{
$this->rows[] = array_values($row);
$keys = array_keys($this->rows);
$rowKey = array_pop($keys);
end($this->rows);
$rowKey = key($this->rows);
reset($this->rows);
foreach ($row as $key => $cellValue) {
if (!strstr($cellValue, "\n")) {