mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Micro optimize extension() in search.cpp
Small micro-optimization in this very time critical function. Use bitwise 'or' instead of logic 'or' to avoid branches in the assembly and use the result to skip an handful of checks. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
1b0303b6e9
commit
bdb586ac2b
1 changed files with 10 additions and 7 deletions
|
@ -2202,8 +2202,10 @@ namespace {
|
|||
assert(m != MOVE_NONE);
|
||||
|
||||
Depth result = Depth(0);
|
||||
*dangerous = check || singleReply || mateThreat;
|
||||
*dangerous = check | singleReply | mateThreat;
|
||||
|
||||
if (*dangerous)
|
||||
{
|
||||
if (check)
|
||||
result += CheckExtension[pvNode];
|
||||
|
||||
|
@ -2212,6 +2214,7 @@ namespace {
|
|||
|
||||
if (mateThreat)
|
||||
result += MateThreatExtension[pvNode];
|
||||
}
|
||||
|
||||
if (pos.type_of_piece_on(move_from(m)) == PAWN)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue