aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-07-21 14:12:56 +0200
committerThomas White <taw@physics.org>2021-07-21 15:34:33 +0200
commitbbf2e57671f8f833689b845d5dc402569183d6d0 (patch)
treeaeb78702e9fe40bde81b25e60aa4c9cf6a083912 /libcrystfel
parentd45d3e765011f99bd84bf52872590a4d8ff89ac7 (diff)
asdf: Remove unnecessary check
'changed' is initialised to zero, so there's no way this check can fail.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/indexers/asdf.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/libcrystfel/src/indexers/asdf.c b/libcrystfel/src/indexers/asdf.c
index a1f8f50d..87fa2f54 100644
--- a/libcrystfel/src/indexers/asdf.c
+++ b/libcrystfel/src/indexers/asdf.c
@@ -591,7 +591,7 @@ static int reduce_asdf_cell(struct asdf_cell *cl)
int n = 0;
while ( changed ) {
- double a, b, c, alpha, beta, gamma, ab, bc, ca;
+ double a, b, c, alpha, beta, gamma, ab, bc, ca, bb;
n += 1;
changed = 0;
@@ -612,28 +612,23 @@ static int reduce_asdf_cell(struct asdf_cell *cl)
beta = acos(ca/a/c)/M_PI*180;
gamma = acos(ab/a/b)/M_PI*180;
- if ( changed == 0 ) {
-
- double bb;
-
- if ( gamma < 90 ) {
- gsl_vector_scale(vb, -1);
- gamma = 180 - gamma;
- alpha = 180 - alpha;
- }
+ if ( gamma < 90 ) {
+ gsl_vector_scale(vb, -1);
+ gamma = 180 - gamma;
+ alpha = 180 - alpha;
+ }
- gsl_vector_add(vb, va);
- bb = gsl_blas_dnrm2(vb);
- if ( bb < b ) {
- b = bb;
- if ( a < b ) {
- gsl_vector_memcpy(cl->axes[1], vb);
- } else {
- gsl_vector_memcpy(cl->axes[1], va);
- gsl_vector_memcpy(cl->axes[0], vb);
- }
- changed = 1;
+ gsl_vector_add(vb, va);
+ bb = gsl_blas_dnrm2(vb);
+ if ( bb < b ) {
+ b = bb;
+ if ( a < b ) {
+ gsl_vector_memcpy(cl->axes[1], vb);
+ } else {
+ gsl_vector_memcpy(cl->axes[1], va);
+ gsl_vector_memcpy(cl->axes[0], vb);
}
+ changed = 1;
}
if ( changed == 0 ) {