mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
[OPTIMISATION] Optimised more foreach loops to improve performance.
This commit is contained in:
@@ -301,8 +301,11 @@ abstract class RouterEntry {
|
||||
if(preg_match('/^'.$regex.'$/is', $url, $parameterValues)) {
|
||||
$parameters = array();
|
||||
|
||||
if(count($parameterNames)) {
|
||||
foreach($parameterNames as $name) {
|
||||
$max = count($parameterNames);
|
||||
|
||||
if(count($max)) {
|
||||
for($i = 0; $i < $max; $i++) {
|
||||
$name = $parameterNames[$i];
|
||||
$parameterValue = (isset($parameterValues[$name['name']]) && !empty($parameterValues[$name['name']])) ? $parameterValues[$name['name']] : null;
|
||||
|
||||
if($name['required'] && $parameterValue === null) {
|
||||
|
||||
Reference in New Issue
Block a user