mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 10:36:26 +08: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
@@ -18,11 +18,12 @@
|
||||
|
||||
// Code for calculating NNUE evaluation function
|
||||
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <fstream>
|
||||
#include <string_view>
|
||||
|
||||
#include "../evaluate.h"
|
||||
#include "../position.h"
|
||||
@@ -210,7 +211,7 @@ namespace Stockfish::Eval::NNUE {
|
||||
return t;
|
||||
}
|
||||
|
||||
static const std::string PieceToChar(" PNBRQK pnbrqk");
|
||||
constexpr std::string_view PieceToChar(" PNBRQK pnbrqk");
|
||||
|
||||
|
||||
// format_cp_compact() converts a Value into (centi)pawns and writes it in a buffer.
|
||||
|
||||
Reference in New Issue
Block a user