mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 12:07:43 +00:00
Correct zero-init of Thread data members
If not explicitly initialized in a class constructor, then all data members are default-initialized when the corresponing struct/class is instanced. For array and built-in types (int, char, etc..) default-initialization is a no-op and we need to explicitly zero them. No functional change.
This commit is contained in:
@@ -41,6 +41,7 @@ struct Stats {
|
||||
|
||||
static const Value Max = Value(1 << 28);
|
||||
|
||||
Stats() { clear(); }
|
||||
const T* operator[](Piece pc) const { return table[pc]; }
|
||||
T* operator[](Piece pc) { return table[pc]; }
|
||||
void clear() { std::memset(table, 0, sizeof(table)); }
|
||||
|
||||
Reference in New Issue
Block a user