Skip to content

Commit e4a61c8

Browse files
Daniel WhiteDaniel White
authored andcommitted
Moved illegal square test out of for loop. Saves 3 bytes.
1 parent 4164f82 commit e4a61c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

iota.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ D(x, y, p, e) {
1515
int f=0,t, i, d, m, v, b;
1616
F ;f<128;f=f+9&~8) { // Loop over squares looking for pieces.
1717
F i=T[(m=B[f])&7]-35,d=0;d<0 || (d=T[i++]-35);d=-d) { // Loop over move steps for this piece.
18-
F t=f;!((t+=d)&(b=136)) && m&S;) { // Loop over destination squares in this direction.
19-
// Friendly capture?
20-
I (v=B[t])&S K
18+
F t=f;m&S;) { // Loop over destination squares in this direction.
19+
// Illegal square or friendly capture?
20+
I (t+=d)&(b=136) || (v=B[t])&S K
2121

2222
// Special pawn logic.
2323
I m%8==2)

0 commit comments

Comments
 (0)