Remove redundant check of domains.
This commit is contained in:
parent
826f66a6fb
commit
292db44e48
3 changed files with 6 additions and 12 deletions
|
|
@ -518,7 +518,6 @@ class App
|
|||
$appClass->getNamespaceName()
|
||||
);
|
||||
|
||||
// Cache routes before weighing.
|
||||
$this->router->cache();
|
||||
|
||||
$this->logger->debug(sprintf(
|
||||
|
|
|
|||
|
|
@ -133,16 +133,6 @@ class Route
|
|||
|
||||
public function populateRoute(App $app): App
|
||||
{
|
||||
/*$this->logger->debug(sprintf(
|
||||
'Router Populating: %s %s',
|
||||
$this->getHttpMethod(),
|
||||
$this->getRouterPattern()
|
||||
));*/
|
||||
|
||||
if ($this->hasValidDomains() && !$this->isInContainedInValidDomains()) {
|
||||
return $app;
|
||||
}
|
||||
|
||||
$mapping = $app->map(
|
||||
[$this->getHttpMethod()],
|
||||
$this->getRouterPattern(),
|
||||
|
|
|
|||
|
|
@ -120,7 +120,12 @@ class Router
|
|||
$allocatedRoutes = [];
|
||||
if (is_array($this->routes) && count($this->routes) > 0) {
|
||||
uasort($this->routes, function (Route $a, Route $b) {
|
||||
return $a->getWeight() > $b->getWeight();
|
||||
$a1 = $a->getWeight();
|
||||
$b1 = $b->getWeight();
|
||||
if ($a1 === $b1) {
|
||||
return 0;
|
||||
}
|
||||
return ($a1 > $b1) ? +1 : -1;
|
||||
});
|
||||
|
||||
foreach ($this->routes as $index => $route) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue