Skip to content

Commit 1cc1e55

Browse files
committed
Save an isEnd() call for each comes() call
We can get this information from the peek() return.
1 parent d7afca0 commit 1cc1e55

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/Sabberworm/CSS/Parser.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,10 @@ private static function identifierIs($sIdentifier, $sMatch, $bCaseInsensitive =
456456
}
457457

458458
private function comes($sString, $iOffset = 0, $bCaseInsensitive = true) {
459-
if ($this->isEnd()) {
460-
return false;
461-
}
462459
$sPeek = $this->peek($sString, $iOffset);
463-
return $this->streql($sPeek, $sString, $bCaseInsensitive);
460+
return ($sPeek == '')
461+
? false
462+
: $this->streql($sPeek, $sString, $bCaseInsensitive);
464463
}
465464

466465
private function peek($iLength = 1, $iOffset = 0) {

0 commit comments

Comments
 (0)