]> git.sesse.net Git - stockfish/commitdiff
Retire Position::see(Square from, Square to) overload
authorMarco Costalba <mcostalba@gmail.com>
Tue, 17 May 2011 10:09:45 +0000 (12:09 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 17 May 2011 11:17:57 +0000 (12:17 +0100)
Alomst unuseful.

No functional change.

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

index e71499ce9b35a02177b23872b12bd8b330de5035..ec4fa14e8692fc5cddcd0dc026358625f7821d7d 100644 (file)
@@ -1490,12 +1490,6 @@ void Position::undo_null_move() {
 /// move, and one which takes a 'from' and a 'to' square. The function does
 /// not yet understand promotions captures.
 
 /// move, and one which takes a 'from' and a 'to' square. The function does
 /// not yet understand promotions captures.
 
-int Position::see(Move m) const {
-
-  assert(move_is_ok(m));
-  return see(move_from(m), move_to(m));
-}
-
 int Position::see_sign(Move m) const {
 
   assert(move_is_ok(m));
 int Position::see_sign(Move m) const {
 
   assert(move_is_ok(m));
@@ -1509,19 +1503,21 @@ int Position::see_sign(Move m) const {
   if (midgame_value_of_piece_on(to) >= midgame_value_of_piece_on(from))
       return 1;
 
   if (midgame_value_of_piece_on(to) >= midgame_value_of_piece_on(from))
       return 1;
 
-  return see(from, to);
+  return see(m);
 }
 
 }
 
-int Position::see(Square from, Square to) const {
+int Position::see(Move m) const {
 
 
+  Square from, to;
   Bitboard occupied, attackers, stmAttackers, b;
   int swapList[32], slIndex = 1;
   PieceType capturedType, pt;
   Color stm;
 
   Bitboard occupied, attackers, stmAttackers, b;
   int swapList[32], slIndex = 1;
   PieceType capturedType, pt;
   Color stm;
 
-  assert(square_is_ok(from));
-  assert(square_is_ok(to));
+  assert(move_is_ok(m));
 
 
+  from = move_from(m);
+  to = move_to(m);
   capturedType = type_of_piece_on(to);
 
   // King cannot be recaptured
   capturedType = type_of_piece_on(to);
 
   // King cannot be recaptured
index 3ea5f6dfbe9fbd82f6965c206d08361fed5d9e1a..7dcbb6f479ab91302e964e50de4c64cae5936e65 100644 (file)
@@ -213,7 +213,6 @@ public:
   void undo_null_move();
 
   // Static exchange evaluation
   void undo_null_move();
 
   // Static exchange evaluation
-  int see(Square from, Square to) const;
   int see(Move m) const;
   int see_sign(Move m) const;
 
   int see(Move m) const;
   int see_sign(Move m) const;