This is a very hot path function, profiling on Intel compiler
shows that inlining cuts in half the overhead.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
}
-/// Position::move_is_capture() tests whether a move from the current
-/// position is a capture. Move must not be MOVE_NONE.
-
-bool Position::move_is_capture(Move m) const {
-
- assert(m != MOVE_NONE);
-
- return ( !square_is_empty(move_to(m))
- && (color_of_piece_on(move_to(m)) != color_of_piece_on(move_from(m)))
- )
- || move_is_ep(m);
-}
-
-
/// Position::update_checkers() udpates chekers info given the move. It is called
/// in do_move() and is faster then find_checkers().
return pawns(c) & relative_rank_bb(c, RANK_7);
}
+inline bool Position::move_is_capture(Move m) const {
+
+ // Move must not be MOVE_NONE !
+
+ return ( !square_is_empty(move_to(m))
+ && (color_of_piece_on(move_to(m)) != color_of_piece_on(move_from(m)))
+ )
+ || move_is_ep(m);
+}
#endif // !defined(POSITION_H_INCLUDED)