Skip to content

Commit

Permalink
Optimized some strlen() calls when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Jul 16, 2021
1 parent 012c146 commit aefb996
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Header/AbstractHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ protected function getEncodableWordTokens(string $string): array
if ($this->tokenNeedsEncoding($token)) {
$encodedToken .= $token;
} else {
if (\strlen($encodedToken) > 0) {
if ('' !== $encodedToken) {
$tokens[] = $encodedToken;
$encodedToken = '';
}
$tokens[] = $token;
}
}
if (\strlen($encodedToken)) {
if ('' !== $encodedToken) {
$tokens[] = $encodedToken;
}

Expand Down

0 comments on commit aefb996

Please sign in to comment.