Explorar o código

Optimize when a pair of curly brackets for key tagging is missing.

Daniele Alessandri %!s(int64=14) %!d(string=hai) anos
pai
achega
007ddaecfa
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      lib/Predis.php

+ 5 - 3
lib/Predis.php

@@ -439,9 +439,11 @@ abstract class Command {
                 $key = $this->_arguments[0];
 
                 $start = strpos($key, '{');
-                $end   = strpos($key, '}');
-                if ($start !== false && $end !== false) {
-                    $key = substr($key, ++$start, $end - $start);
+                if ($start !== false) {
+                    $end = strpos($key, '}');
+                    if ($end !== false) {
+                        $key = substr($key, ++$start, $end - $start);
+                    }
                 }
 
                 $this->_hash = $distributor->generateKey($key);