]> git.sesse.net Git - stockfish/blobdiff - src/square.h
Use opposite_color_squares() instead of same_color_squares()
[stockfish] / src / square.h
index 5e474f0f4a7574b0a04e3484664f0168ac463abf..0e314b04ac809f017d42d162a8d381caad9b8d99 100644 (file)
@@ -107,9 +107,9 @@ inline SquareColor square_color(Square s) {
   return SquareColor((int(square_file(s)) + int(square_rank(s))) & 1);
 }
 
-inline bool same_color_squares(Square s1, Square s2) {
+inline bool opposite_color_squares(Square s1, Square s2) {
   int s = int(s1) ^ int(s2);
-  return (((s >> 3) ^ s) & 1) == 0;
+  return ((s >> 3) ^ s) & 1;
 }
 
 inline int file_distance(File f1, File f2) {