diff options
author | Thomas White <taw@physics.org> | 2011-07-27 12:16:39 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:34 +0100 |
commit | 0ca816fdeae85779ef4a8100cdc25ec16fc9d735 (patch) | |
tree | c9f5d1d21a4030b4c53f755791f660f163b5af3d /src/reflist-utils.c | |
parent | 645edae8173996f28686315b05253d4d4db94ccb (diff) |
Don't use an array in check_list_symmetry()
Diffstat (limited to 'src/reflist-utils.c')
-rw-r--r-- | src/reflist-utils.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/reflist-utils.c b/src/reflist-utils.c index 3991600d..af43b1ff 100644 --- a/src/reflist-utils.c +++ b/src/reflist-utils.c @@ -106,12 +106,10 @@ unsigned char *flags_from_list(RefList *list) int check_list_symmetry(RefList *list, const SymOpList *sym) { - unsigned char *flags; Reflection *refl; RefListIterator *iter; SymOpMask *mask; - flags = flags_from_list(list); mask = new_symopmask(sym); if ( mask == NULL ) { ERROR("Couldn't create mask for list symmetry check.\n"); @@ -135,26 +133,24 @@ int check_list_symmetry(RefList *list, const SymOpList *sym) for ( j=0; j<n; j++ ) { signed int he, ke, le; - get_equiv(sym, mask, j, h, k, l, &he, &ke, &le); + Reflection *f; - if ( abs(he) > INDMAX ) continue; - if ( abs(le) > INDMAX ) continue; - if ( abs(ke) > INDMAX ) continue; + get_equiv(sym, mask, j, h, k, l, &he, &ke, &le); - found += lookup_flag(flags, he, ke, le); + f = find_refl(list, he, ke, le); + if ( f != NULL ) found++; } + assert(found != 0); /* That'd just be silly */ if ( found > 1 ) { - free(flags); free_symopmask(mask); - STATUS("Found %i %i %i twice\n", h, k, l); + STATUS("Found %i %i %i: %i times\n", h, k, l, found); return 1; /* Symmetry is wrong! */ } } - free(flags); free_symopmask(mask); return 0; |