Skip to content

Commit

Permalink
small speed improvement, move assignment outside loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ifsnop committed Sep 8, 2014
1 parent b79e513 commit f52c6a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Ifsnop/Mysqldump/Mysqldump.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,11 @@ private function getViewStructure($viewName)
private function escape($tableName, $row)
{
$ret = array();
$columnTypes = $this->tableColumnTypes[$tableName];
foreach ($row as $colName => $colValue) {
if (is_null($colValue)) {
$ret[] = "NULL";
} elseif ($this->tableColumnTypes[$tableName][$colName]) {
} elseif ($columnTypes[$colName]) {
// if (ctype_digit($val) && ((string) intval($val) === $val)) {
// Since "(string) intval($val) === $val" is slower, first check ctype_digit, then run comparison
// We can't use ctype_digit alone, as this will trim off leading zeros on string values
Expand Down

0 comments on commit f52c6a2

Please sign in to comment.