Remove usage of asserts with strings

This commit is contained in:
Daniel Hensby 2017-11-30 18:11:59 +00:00
parent 9103816333
commit e23fcda6b6
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -413,7 +413,7 @@ class _DiffEngine
$i = 0;
$j = 0;
USE_ASSERTS && assert('sizeof($lines) == sizeof($changed)');
USE_ASSERTS && assert(sizeof($lines) == sizeof($changed));
$len = sizeof($lines);
$other_len = sizeof($other_changed);
@ -433,7 +433,7 @@ class _DiffEngine
$j++;
while ($i < $len && ! $changed[$i]) {
USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]');
USE_ASSERTS && assert($j < $other_len && ! $other_changed[$j]);
$i++; $j++;
while ($j < $other_len && $other_changed[$j])
$j++;
@ -465,10 +465,10 @@ class _DiffEngine
$changed[--$i] = false;
while ($start > 0 && $changed[$start - 1])
$start--;
USE_ASSERTS && assert('$j > 0');
USE_ASSERTS && assert($j > 0);
while ($other_changed[--$j])
continue;
USE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]');
USE_ASSERTS && assert($j >= 0 && !$other_changed[$j]);
}
/*
@ -491,7 +491,7 @@ class _DiffEngine
while ($i < $len && $changed[$i])
$i++;
USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]');
USE_ASSERTS && assert($j < $other_len && ! $other_changed[$j]);
$j++;
if ($j < $other_len && $other_changed[$j]) {
$corresponding = $i;
@ -508,10 +508,10 @@ class _DiffEngine
while ($corresponding < $i) {
$changed[--$start] = 1;
$changed[--$i] = 0;
USE_ASSERTS && assert('$j > 0');
USE_ASSERTS && assert($j > 0);
while ($other_changed[--$j])
continue;
USE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]');
USE_ASSERTS && assert($j >= 0 && !$other_changed[$j]);
}
}
}