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:
Sebastian Buchwald
2023-01-07 14:53:59 +01:00
committed by Joost VandeVondele
parent 5a88c5bb9b
commit e9e7a7b83f
4 changed files with 15 additions and 11 deletions
+4 -3
View File
@@ -24,9 +24,10 @@
#include <fstream>
#include <iostream>
#include <list>
#include <sstream>
#include <type_traits>
#include <mutex>
#include <sstream>
#include <string_view>
#include <type_traits>
#include "../bitboard.h"
#include "../movegen.h"
@@ -70,7 +71,7 @@ enum TBFlag { STM = 1, Mapped = 2, WinPlies = 4, LossPlies = 8, Wide = 16, Singl
inline WDLScore operator-(WDLScore d) { return WDLScore(-int(d)); }
inline Square operator^(Square s, int i) { return Square(int(s) ^ i); }
const std::string PieceToChar = " PNBRQK pnbrqk";
constexpr std::string_view PieceToChar = " PNBRQK pnbrqk";
int MapPawns[SQUARE_NB];
int MapB1H1H7[SQUARE_NB];