]> git.sesse.net Git - stockfish/commitdiff
Another generate_piece_moves() micro optimization
authorMarco Costalba <mcostalba@gmail.com>
Thu, 23 Oct 2008 07:47:00 +0000 (09:47 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 24 Oct 2008 19:10:04 +0000 (21:10 +0200)
This time on the for loop.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/movegen.cpp

index 95a73737790eda1a685f438a522e248416235d59..54af3222e5b21b7657edf691a791d1fbc8d5cbf1 100644 (file)
@@ -576,7 +576,7 @@ namespace {
     Square from, to;
     Bitboard b;
 
     Square from, to;
     Bitboard b;
 
-    for (int i = 0; i < pos.piece_count(us, Piece); i++)
+    for (int i = 0, e = pos.piece_count(us, Piece); i < e; i++)
     {
         from = pos.piece_list(us, Piece, i);
         b = pos.piece_attacks<Piece>(from) & target;
     {
         from = pos.piece_list(us, Piece, i);
         b = pos.piece_attacks<Piece>(from) & target;