Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Patched CakeResponse's MapType() to increase performance by reducing …

…hundreds of is_array() and is_string() system calls
  • Loading branch information...
commit 255fe004ebc89d66ddd17b7dc242f006d422aa34 1 parent 5682907
@DiegoMax DiegoMax authored
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/Cake/Network/CakeResponse.php
View
4 lib/Cake/Network/CakeResponse.php
@@ -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;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.