Skip to content

Commit

Permalink
Patched CakeResponse's MapType() to increase performance by reducing …
Browse files Browse the repository at this point in the history
…hundreds of is_array() and is_string() system calls
  • Loading branch information
DiegoMax committed May 1, 2013
1 parent 5682907 commit 255fe00
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/Cake/Network/CakeResponse.php
Expand Up @@ -717,9 +717,7 @@ public function mapType($ctype) {
}

foreach ($this->_mimeTypes as $alias => $types) {
if (is_array($types) && in_array($ctype, $types)) {
return $alias;
} elseif (is_string($types) && $types == $ctype) {
if (in_array($ctype, (array)$types)) {
return $alias;
}
}
Expand Down

0 comments on commit 255fe00

Please sign in to comment.