Skip to content

Commit

Permalink
partially inline struct Evaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocodutra committed Nov 26, 2023
1 parent a34f2cd commit aaa0fa6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/nnue/evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,16 @@ impl<T: Clone + Accumulator> Evaluator<T> {
/// Exchange a piece on [`Square`] by the attacker of least value.
///
/// This may lead to invalid positions.
pub fn exchange(&mut self, whither: Square) -> Result<Move, ImpossibleExchange> {
#[inline(always)]
fn exchange(&mut self, whither: Square) -> Result<Move, ImpossibleExchange> {
let capture = self.role_on(whither);
let m = self.pos.exchange(whither)?;
self.acc.mirror();
self.update(m, capture);
Ok(m)
}

#[inline(always)]
fn update(&mut self, m: Move, capture: Option<Role>) {
let turn = self.turn();

Expand Down

0 comments on commit aaa0fa6

Please sign in to comment.