OSDN Git Service
(root)
/
php-libraries
/
Router.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ae492b8
)
avoid calling getName twice per route
author
maks feltrin
<pine3ree@gmail.com>
Wed, 10 Feb 2016 17:10:55 +0000
(18:10 +0100)
committer
maks feltrin
<pine3ree@gmail.com>
Wed, 10 Feb 2016 17:10:55 +0000
(18:10 +0100)
src/PHPRouter/Router.php
patch
|
blob
|
history
diff --git
a/src/PHPRouter/Router.php
b/src/PHPRouter/Router.php
index
a307ae8
..
b9e7260
100755
(executable)
--- a/
src/PHPRouter/Router.php
+++ b/
src/PHPRouter/Router.php
@@
-52,8
+52,9
@@
class Router
$this->routes = $collection;
foreach ($this->routes->all() as $route) {
- if (!is_null($route->getName())) {
- $this->namedRoutes[$route->getName()] = $route;
+ $name = $route->getName();
+ if (null !== $name) {
+ $this->namedRoutes[$name] = $route;
}
}
}