]> git.sesse.net Git - stockfish/commitdiff
Remove a useless optimization
authorlucasart <lucas.braesch@gmail.com>
Sat, 3 Jan 2015 11:29:00 +0000 (19:29 +0800)
committerJoona Kiiski <joona.kiiski@gmail.com>
Sat, 3 Jan 2015 20:40:57 +0000 (20:40 +0000)
This optimization is aimed at old hardware only (withouth popcount), and even on
non popcount compile (ARCH=x86-64), it provides no mesurable speedup:

stat        test     master     diff
mean   2,341,779  2,354,699  -12,920
stdev     12,910     14,770   18,150

speedup      -0.55%
P(speedup>0)  23.8%

No functional change.

Resolves #187

src/evaluate.cpp

index 6a27108d9f4b6c3f2da3bfcc239760081142428d..681042c7c658dd43fbb386ee8a2a98b653a0f80e 100644 (file)
@@ -534,7 +534,7 @@ namespace {
 
         b = weak & ~ei.attackedBy[Them][ALL_PIECES];
         if (b)
-            score += more_than_one(b) ? Hanging * popcount<Max15>(b) : Hanging;
+            score += Hanging * popcount<Max15>(b);
 
         b = weak & ei.attackedBy[Us][KING];
         if (b)