mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 05:07:46 +00:00
Replace some std::string occurrences with std::string_view
std::string_view is more lightweight than std::string. Furthermore, std::string_view variables can be declared constexpr. closes https://github.com/official-stockfish/Stockfish/pull/4328 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
5a88c5bb9b
commit
e9e7a7b83f
+2
-1
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user