X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=c0c26f038d5c5b4de7caa59d0a9e2f6a4041ce2c;hp=994e1c767ccfc05cce8e41c4bf35bab967a4c484;hb=60c121f3b1ee7d5ced3435cc1718e4e6e6fd8383;hpb=4eb2d8ce095b284a1e55762548d9821a83a19b3b diff --git a/src/position.cpp b/src/position.cpp index 994e1c76..c0c26f03 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1147,10 +1147,6 @@ bool Position::is_draw() const { /// Position::flip() flips position with the white and black sides reversed. This /// is only useful for debugging e.g. for finding evaluation symmetry bugs. -static char toggle_case(char c) { - return char(islower(c) ? toupper(c) : tolower(c)); -} - void Position::flip() { string f, token; @@ -1168,7 +1164,8 @@ void Position::flip() { ss >> token; // Castling availability f += token + " "; - std::transform(f.begin(), f.end(), f.begin(), toggle_case); + std::transform(f.begin(), f.end(), f.begin(), + [](char c) { return char(islower(c) ? toupper(c) : tolower(c)); }); ss >> token; // En passant square f += (token == "-" ? token : token.replace(1, 1, token[1] == '3' ? "6" : "3"));