Ver Fonte

[HttpFoundation] minor optimization

Igor Wiedler há 14 anos atrás
pai
commit
041a2e9d83
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      src/Symfony/Component/HttpFoundation/RequestMatcher.php

+ 1 - 1
src/Symfony/Component/HttpFoundation/RequestMatcher.php

@@ -157,7 +157,7 @@ class RequestMatcher implements RequestMatcherInterface
         $bytes_addr = unpack("n*", inet_pton($address));
         $bytes_test = unpack("n*", inet_pton($ip));
 
-        for ($i = 1; $i <= ceil($netmask / 16); $i++) {
+        for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; $i++) {
             $left = $netmask - 16 * ($i-1);
             $left = ($left <= 16) ?: 16;
             $mask = ~(0xffff >> $left) & 0xffff;