chiark
/
gitweb
/
~ianmdlvl
/
matchsticks-search.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
966b39b
)
move had_max and totalfrags update later in loop body (no functional change)
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 9 Mar 2014 10:46:32 +0000
(10:46 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 9 Mar 2014 10:46:32 +0000
(10:46 +0000)
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index e8915f7c5661dcd93fb75479e22f80ebce7f629a..b248631b7b819329ffb8b186cad2030e086f1189 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-389,14
+389,14
@@
static bool preconsider_ok(int nwords, bool doprint) {
bool had_max = 0;
for (i=0, totalfrags=0; i<nwords; i++) {
int frags = count_set_adj_bits(adjmatrix[i]);
- had_max += (frags >= maxhamweight);
- totalfrags += frags;
PRINTF("%"PRADJ" ", adjmatrix[i]);
double maxminsize = (double)m / frags;
if (maxminsize <= best) {
PRINTF(" too fine");
goto out;
}
+ had_max += (frags >= maxhamweight);
+ totalfrags += frags;
}
if (!had_max) {
/* Skip this candidate as its max hamming weight is lower than