avoid some static analysis errors

Modify the code to avoid some false positives reported by the clang and
gcc static analyzers.
This commit is contained in:
Miroslav Lichvar
2024-04-11 09:20:44 +02:00
parent a914140bd4
commit 342b588e3b
3 changed files with 6 additions and 7 deletions

View File

@@ -377,7 +377,7 @@ find_ordered_entry_with_flags(double *x, int n, int index, char *flags)
r = v;
do {
while (l < v && x[l] < piv) l++;
while (x[r] > piv) r--;
while (r > 0 && x[r] > piv) r--;
if (r <= l) break;
EXCH(x[l], x[r]);
l++;