mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 01:56:58 +08:00
Fun with initializer lists in UCI::square
No functional change.
This commit is contained in:
@@ -232,9 +232,7 @@ string UCI::value(Value v) {
|
|||||||
/// UCI::square() converts a Square to a string in algebraic notation (g1, a7, etc.)
|
/// UCI::square() converts a Square to a string in algebraic notation (g1, a7, etc.)
|
||||||
|
|
||||||
std::string UCI::square(Square s) {
|
std::string UCI::square(Square s) {
|
||||||
|
return std::string{ char('a' + file_of(s)), char('1' + rank_of(s)) };
|
||||||
char sq[] = { char('a' + file_of(s)), char('1' + rank_of(s)), 0 }; // NULL terminated
|
|
||||||
return sq;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user