Skip to content

Commit 8045c0c

Browse files
committed
Improve int parser
1 parent ded48d9 commit 8045c0c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/Node/Literal/IntLiteral/IntParser.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ private static function toDecimal(string $digits, IntBase $base): string
138138

139139
private static function parseSuffix(string $suffix): ?IntTypeSuffix
140140
{
141+
$isUnsigned = \stripos($suffix, 'u') !== false;
141142
$suffix = \strtolower(\str_ireplace(['u', 'i', 'j'], '', $suffix));
142143

143-
// is unsigned?
144-
if (\stripos($suffix, 'u') !== false) {
144+
if ($isUnsigned) {
145145
return match ($suffix) {
146146
'l' => IntTypeSuffix::UnsignedLong,
147147
'll' => IntTypeSuffix::UnsignedLongLong,

0 commit comments

Comments
 (0)