1
0
Fork 0

use string concatenation instead of sprintf

pull/451/head
Nicolas MURE 2017-11-16 17:44:04 +01:00
parent 7511e255ff
commit fcdf791c2c
No known key found for this signature in database
GPG Key ID: E5B036F9145C4CAA
1 changed files with 5 additions and 5 deletions

View File

@ -292,9 +292,9 @@ class Index implements ReadableIndex, \Serializable
{ {
foreach ($storage as $key => $value) { foreach ($storage as $key => $value) {
if (!is_array($value)) { if (!is_array($value)) {
yield sprintf('%s%s', $prefix, $key) => $value; yield $prefix.$key => $value;
} else { } else {
yield from $this->yieldDefinitionsRecursively($value, sprintf('%s%s', $prefix, $key)); yield from $this->yieldDefinitionsRecursively($value, $prefix.$key);
} }
} }
} }
@ -319,12 +319,12 @@ class Index implements ReadableIndex, \Serializable
$parts = array_slice($parts, 1); $parts = array_slice($parts, 1);
} }
$parts[0] = sprintf('\\%s', $parts[0]); $parts[0] = '\\'.$parts[0];
} }
// write back the backslashes prefixes for the other parts // write back the backslashes prefixes for the other parts
for ($i = 1; $i < count($parts); $i++) { for ($i = 1; $i < count($parts); $i++) {
$parts[$i] = sprintf('\\%s', $parts[$i]); $parts[$i] = '\\'.$parts[$i];
} }
// split the last part in 2 parts at the operator // split the last part in 2 parts at the operator
@ -337,7 +337,7 @@ class Index implements ReadableIndex, \Serializable
// replace the last part by its pieces // replace the last part by its pieces
array_pop($parts); array_pop($parts);
$parts[] = $endParts[0]; $parts[] = $endParts[0];
$parts[] = sprintf('%s%s', $operator, $endParts[1]); $parts[] = $operator.$endParts[1];
break; break;
} }
} }