Skip to content

Commit 7f449b2

Browse files
committed
Fix the new error() implementation a little
1 parent 04bd504 commit 7f449b2

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/HJSON/HJSONParser.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,10 @@ private function error($m)
305305
$col=0;
306306
$colBytes = 0;
307307
$line=1;
308-
for ($i = $this->at-1; $i > 0 && @$this->text[$i] !== "\n"; $i--, $col++) {
309-
}
310308

311309
$i = $this->at;
312310
while ($i > 0) {
313-
$ch = mb_substr(mb_strcut($this->text, $i - 1), 0, 1);
314-
$i += strlen($ch);
311+
$i -= strlen($ch);
315312

316313
if ($ch === "\n") {
317314
break;

0 commit comments

Comments
 (0)