Skip to content

Commit b5d38ad

Browse files
committed
Initialize futilityMargin in EvalInfo c'tor
This is less prone to bugs because now it's up to the compiler don't forget this important initialization. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
1 parent 000a975 commit b5d38ad

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/evaluate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class Position;
4747

4848
struct EvalInfo {
4949

50+
EvalInfo() : futilityMargin(Value(0)) {}
51+
5052
// Middle game and endgame evaluations
5153
Score value;
5254

src/search.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,6 @@ namespace {
13701370
}
13711371

13721372
isCheck = pos.is_check();
1373-
ei.futilityMargin = Value(0); // Manually initialize futilityMargin
13741373

13751374
// Calculate depth dependant futility pruning parameters
13761375
const int FutilityMoveCountMargin = 3 + (1 << (3 * int(depth) / 8));
@@ -1672,7 +1671,6 @@ namespace {
16721671
}
16731672

16741673
isCheck = pos.is_check();
1675-
ei.futilityMargin = Value(0); // Manually initialize futilityMargin
16761674

16771675
// Evaluate the position statically
16781676
if (isCheck)

0 commit comments

Comments
 (0)