]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Replace some std::string occurrences with std::string_view
[stockfish] / src / position.cpp
index e82425af7c459ddebfe4d012d3f396be8a566f6d..cfd98f686e03ac21ef013437d91cb7d636fd24ef 100644 (file)
@@ -22,6 +22,7 @@
 #include <cstring> // For std::memset, std::memcmp
 #include <iomanip>
 #include <sstream>
+#include <string_view>
 
 #include "bitboard.h"
 #include "misc.h"
@@ -46,7 +47,7 @@ namespace Zobrist {
 
 namespace {
 
-const string PieceToChar(" PNBRQK  pnbrqk");
+constexpr std::string_view PieceToChar(" PNBRQK  pnbrqk");
 
 constexpr Piece Pieces[] = { W_PAWN, W_KNIGHT, W_BISHOP, W_ROOK, W_QUEEN, W_KING,
                              B_PAWN, B_KNIGHT, B_BISHOP, B_ROOK, B_QUEEN, B_KING };