Skip to content

Commit 96e4932

Browse files
committed
Fix: Do not use strings as arguments to assert()
1 parent d12474d commit 96e4932

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Text/Diff/Engine/native.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ function _shiftBoundaries($lines, &$changed, $other_changed)
332332
$i = 0;
333333
$j = 0;
334334

335-
assert('count($lines) == count($changed)');
335+
assert(count($lines) == count($changed));
336336
$len = count($lines);
337337
$other_len = count($other_changed);
338338

@@ -353,7 +353,7 @@ function _shiftBoundaries($lines, &$changed, $other_changed)
353353
}
354354

355355
while ($i < $len && ! $changed[$i]) {
356-
assert('$j < $other_len && ! $other_changed[$j]');
356+
assert($j < $other_len && ! $other_changed[$j]);
357357
$i++; $j++;
358358
while ($j < $other_len && $other_changed[$j]) {
359359
$j++;
@@ -385,11 +385,11 @@ function _shiftBoundaries($lines, &$changed, $other_changed)
385385
while ($start > 0 && $changed[$start - 1]) {
386386
$start--;
387387
}
388-
assert('$j > 0');
388+
assert($j > 0);
389389
while ($other_changed[--$j]) {
390390
continue;
391391
}
392-
assert('$j >= 0 && !$other_changed[$j]');
392+
assert($j >= 0 && !$other_changed[$j]);
393393
}
394394

395395
/* Set CORRESPONDING to the end of the changed run, at the
@@ -410,7 +410,7 @@ function _shiftBoundaries($lines, &$changed, $other_changed)
410410
$i++;
411411
}
412412

413-
assert('$j < $other_len && ! $other_changed[$j]');
413+
assert($j < $other_len && ! $other_changed[$j]);
414414
$j++;
415415
if ($j < $other_len && $other_changed[$j]) {
416416
$corresponding = $i;
@@ -426,11 +426,11 @@ function _shiftBoundaries($lines, &$changed, $other_changed)
426426
while ($corresponding < $i) {
427427
$changed[--$start] = 1;
428428
$changed[--$i] = 0;
429-
assert('$j > 0');
429+
assert($j > 0);
430430
while ($other_changed[--$j]) {
431431
continue;
432432
}
433-
assert('$j >= 0 && !$other_changed[$j]');
433+
assert($j >= 0 && !$other_changed[$j]);
434434
}
435435
}
436436
}

Text/Diff/Engine/shell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function diff($from_lines, $to_lines)
8585

8686
if ($from_line_no < $match[1] || $to_line_no < $match[4]) {
8787
// copied lines
88-
assert('$match[1] - $from_line_no == $match[4] - $to_line_no');
88+
assert($match[1] - $from_line_no == $match[4] - $to_line_no);
8989
array_push($edits,
9090
new Text_Diff_Op_copy(
9191
$this->_getLines($from_lines, $from_line_no, $match[1] - 1),

0 commit comments

Comments
 (0)