]> git.sesse.net Git - stockfish/commitdiff
Fun with initializer lists in UCI::square
authorMarco Costalba <mcostalba@gmail.com>
Sun, 18 Jan 2015 10:04:51 +0000 (11:04 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 18 Jan 2015 10:04:51 +0000 (11:04 +0100)
No functional change.

src/uci.cpp

index dfcce4970a67eb6910b38002464fe7dae687eeb7..f05a114e51993088df0c20cc2b86dda2bbc5436f 100644 (file)
@@ -232,9 +232,7 @@ string UCI::value(Value v) {
 /// UCI::square() converts a Square to a string in algebraic notation (g1, a7, etc.)
 
 std::string UCI::square(Square s) {
-
-  char sq[] = { char('a' + file_of(s)), char('1' + rank_of(s)), 0 }; // NULL terminated
-  return sq;
+  return std::string{ char('a' + file_of(s)), char('1' + rank_of(s)) };
 }