aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-05-06 12:01:50 +0200
committerThomas White <taw@physics.org>2022-06-02 12:15:38 +0200
commit540884d85b8fd7449946869bd811d153b7de65a5 (patch)
tree0dd017fe030e9c2d874fb4b27477f562f8fedf30
parentb0bf26431f5e4fb6bb2cb5ae3501fd57a10d15c2 (diff)
Use isfinite() instead of isnan() || isinf()
These FP calls seem to be slower than expected. Using only one doubles the speed.
-rw-r--r--libcrystfel/src/image.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index f9c75b19..5dccfec6 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -887,8 +887,7 @@ static void mark_flagged_pixels_naninf(float *dp, int *bad,
{
long int i;
for ( i=0; i<n; i++ ) {
- float val = dp[i];
- if ( isnan(val) || isinf(val) ) bad[i] = 1;
+ if ( !isfinite(dp[i]) ) bad[i] = 1;
}
}