🚿 fewer function calls for numeric and alphanum table checks

This commit is contained in:
codemasher
2020-04-01 00:51:46 +02:00
parent 4c395abfd4
commit 2f337fe43d
4 changed files with 15 additions and 14 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ final class Number extends QRDataAbstract{
for($i = 0; $i < $len; $i++){
$c = ord($string[$i]);
if(!in_array($string[$i], $this::CHAR_MAP_NUMBER, true)){
if(!isset($this::CHAR_MAP_NUMBER[$string[$i]])){
throw new QRCodeDataException(sprintf('illegal char: "%s" [%d]', $string[$i], $c));
}