@@ -10,9 +10,7 @@ using namespace chess;
1010namespace engine {
1111TranspositionTable search::tt (16 );
1212std::atomic<bool > stopSearch{false };
13- void search::stop () {
14- stopSearch.store (true , std::memory_order_relaxed);
15- }
13+ void search::stop () { stopSearch.store (true , std::memory_order_relaxed); }
1614struct Session {
1715 timeman::TimeManagement tm;
1816 timeman::LimitsType tc;
@@ -71,7 +69,7 @@ Value doSearch(Board &board, int depth, Value alpha, Value beta,
7169 uint64_t hash = board.hash ();
7270 Move preferred = Move::none ();
7371 if (TTEntry *entry = search::tt.lookup (hash)) {
74- if (entry->getDepth () >= depth && ply!= 0 ) {
72+ if (entry->getDepth () >= depth && ply != 0 ) {
7573 Value ttScore = entry->getScore ();
7674 TTFlag flag = entry->getFlag ();
7775
@@ -163,7 +161,7 @@ Value doSearch(Board &board, int depth, Value alpha, Value beta,
163161}
164162void search::search (const chess::Board &board,
165163 const timeman::LimitsType timecontrol) {
166- stopSearch= false ;
164+ stopSearch = false ;
167165 static double originalTimeAdjust = -1 ;
168166 Session session;
169167 session.tc = timecontrol;
@@ -195,7 +193,17 @@ void search::search(const chess::Board &board,
195193 info.multiPV = 1 ;
196194 info.score = score_;
197195 TTEntry *entry = tt.lookup (board.hash ());
198- if (entry) switch (entry->getFlag ()){ case LOWERBOUND: info.bound =" lowerbound" ; break ; case UPPERBOUND: info.bound =" upperbound" ;break ;default :break ;}
196+ if (entry)
197+ switch (entry->getFlag ()) {
198+ case LOWERBOUND:
199+ info.bound = " lowerbound" ;
200+ break ;
201+ case UPPERBOUND:
202+ info.bound = " upperbound" ;
203+ break ;
204+ default :
205+ break ;
206+ }
199207 std::string pv = " " ;
200208 for (Move *m = session.pv [0 ]; *m != Move::none (); m++)
201209 pv += chess::uci::moveToUci (*m, board.chess960 ()) + " " ;
0 commit comments