OSDN Git Service
(root)
/
php-libraries
/
Router.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
ae492b8
)
Merge pull request #72 from pine3ree/patch-1
author
Jefersson Nathan
<admin@phpse.net>
Wed, 10 Feb 2016 17:40:02 +0000
(14:40 -0300)
committer
Jefersson Nathan
<admin@phpse.net>
Wed, 10 Feb 2016 17:40:02 +0000
(14:40 -0300)
avoid calling getName twice per route
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;
}
}
}