From d99a95df29574634146ec04a20726829681b2e23 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Mon, 29 Dec 2008 11:57:07 +0100 Subject: [PATCH] Micro optimization in extension() Signed-off-by: Marco Costalba --- src/search.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 2fe6a5c1..3529627f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -2195,15 +2195,18 @@ namespace { if (mateThreat) result += MateThreatExtension[pvNode]; - if (pos.move_is_pawn_push_to_7th(m)) + if (pos.type_of_piece_on(move_from(m)) == PAWN) { - result += PawnPushTo7thExtension[pvNode]; - *dangerous = true; - } - if (pos.move_is_passed_pawn_push(m)) - { - result += PassedPawnExtension[pvNode]; - *dangerous = true; + if (pos.move_is_pawn_push_to_7th(m)) + { + result += PawnPushTo7thExtension[pvNode]; + *dangerous = true; + } + if (pos.move_is_passed_pawn_push(m)) + { + result += PassedPawnExtension[pvNode]; + *dangerous = true; + } } if ( pos.move_is_capture(m) -- 2.39.2