Navigation Menu

Skip to content

Commit

Permalink
coercion for floats was actaully not faster
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Feb 26, 2018
1 parent 1bd3fd8 commit 467d54b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Database/Type/FloatType.php
Expand Up @@ -96,10 +96,7 @@ public function toPHP($value, Driver $driver)
return null;
}

// Using coersion is faster than casting
// @codingStandardsIgnoreStart
return (float)+$value;
// @codingStandardsIgnoreEnd
return (float)$value;
}

/**
Expand All @@ -114,10 +111,7 @@ public function manyToPHP(array $values, array $fields, Driver $driver)
continue;
}

// Using coersion is faster than casting
// @codingStandardsIgnoreStart
$values[$field] = (float)+$values[$field];
// @codingStandardsIgnoreEnd
$values[$field] = (float)$values[$field];
}

return $values;
Expand Down

0 comments on commit 467d54b

Please sign in to comment.