Skip to content

Commit 9db72a0

Browse files
committed
Minor optimization
1 parent dfd8374 commit 9db72a0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/Sabberworm/CSS/Parser.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ private function peek($iLength = 1, $iOffset = 0) {
490490
if ($iOffset >= $this->iLength) {
491491
return '';
492492
}
493-
$iLength = min($iLength, $this->iLength-$iOffset);
494493
$out = $this->substr($iOffset, $iLength);
495494
return $out;
496495
}
@@ -585,7 +584,7 @@ private function inputLeft() {
585584

586585
private function substr($iStart, $iLength) {
587586
$out = '';
588-
while ($iLength > 0) {
587+
while ($iLength > 0 && $iStart < $this->iLength) {
589588
$out .= $this->aText[$iStart];
590589
$iStart++;
591590
$iLength--;

0 commit comments

Comments
 (0)