Skip to content

Commit

Permalink
uksort replaced by array_replace to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
evgpisarchik committed May 14, 2017
1 parent 87251a1 commit 97f0db3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/Doctrine/DBAL/Schema/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,7 @@ public function getColumns()
}
$colNames = array_unique(array_merge($pkCols, $fkCols, array_keys($columns)));

uksort($columns, function ($a, $b) use ($colNames) {
return (array_search($a, $colNames) >= array_search($b, $colNames));
});

return $columns;
return array_replace(array_flip($colNames), $columns);
}

/**
Expand Down

0 comments on commit 97f0db3

Please sign in to comment.