Adding break; to escape out of prefix checking, optimizes operations with many prefixes.

This commit is contained in:
mark_story 2009-09-30 10:01:08 -04:00
parent f0276414ad
commit d2b4e33e1b

View file

@ -913,6 +913,7 @@ class Router {
foreach ($_this->__prefixes as $prefix) {
if (!empty($url[$prefix])) {
$url['action'] = str_replace($prefix . '_', '', $url['action']);
break;
}
}
@ -929,6 +930,7 @@ class Router {
foreach ($_this->__prefixes as $prefix) {
if (isset($url[$prefix])) {
array_unshift($urlOut, $prefix);
break;
}
}
$output = join('/', $urlOut) . '/';
@ -964,6 +966,7 @@ class Router {
foreach ($_this->__prefixes as $prefix) {
if (isset($params[$prefix])) {
$output .= $prefix . '/';
break;
}
}
if (!empty($params['plugin']) && $params['plugin'] !== $params['controller']) {