Skip to content

Commit 0aa6b2e

Browse files
rocketmarkclaude
andcommitted
mp_fdjac2: drop asserts made redundant by isfinite guard
bl4ckb0ne noted on PR collabora#364 that once the isfinite() sanitize-to-zero guard runs, the following assert(isfinite(fjac[ij])) can never fire in a debug build and is already a no-op under -DNDEBUG. Removed both now-dead asserts (one-sided non-debug and debug paths). Claude Code assisted with this change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 82423c8 commit 0aa6b2e

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

redist/mpfit/mpfit.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,6 @@ static int mp_fdjac2(mp_func funct, int m, int n, int *ifree, int npar, FLT *x,
12311231
/* assert is compiled out under NDEBUG; guard for real. */
12321232
if (!isfinite(fjac[ij]))
12331233
fjac[ij] = 0;
1234-
assert(isfinite(fjac[ij]));
12351234
}
12361235
} else {
12371236
/* Debug path for correctness */
@@ -1240,7 +1239,6 @@ static int mp_fdjac2(mp_func funct, int m, int n, int *ifree, int npar, FLT *x,
12401239
fjac[ij] = (wa[i] - fvec[i]) / h; /* fjac[i+m*j] */
12411240
if (!isfinite(fjac[ij]))
12421241
fjac[ij] = 0;
1243-
assert(isfinite(fjac[ij]));
12441242
if ((da == 0 && dr == 0 && (fjold != 0 || fjac[ij] != 0)) ||
12451243
((da != 0 || dr != 0) && (fabs(fjold - fjac[ij]) > da + fabs(fjold) * dr))) {
12461244
fprintf(stderr, " %10d %10.4g %10.4g %10.4g %10.4g %10.4g\n", i, fvec[i], fjold, fjac[ij],

0 commit comments

Comments
 (0)