Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
fix: removed unnecessary print statement & refactored Color::negation…
Browse files Browse the repository at this point in the history
…_multiplier
  • Loading branch information
dannyhammer committed Aug 15, 2024
1 parent f2e4d32 commit 249bd82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions brogle/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,6 @@ impl UciEngine for Engine {
Duration::MAX
};

eprintln!("Received duration of {time_remaining:?}");

// Clone the arcs for whether we're searching and our found results
let is_searching = Arc::clone(&self.is_searching);
// let timeout = Duration::from_secs_f32(time_remaining.as_secs_f32() / 20.0); // 5% time remaining
Expand Down
16 changes: 8 additions & 8 deletions brogle_core/brogle_types/src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,16 @@ impl Color {
// TODO: Which of these 3 is faster?

// A: Match
// match self {
// Self::White => 1,
// Self::Black => -1,
// }
match self {
Self::White => 1,
Self::Black => -1,
}

// B: Multiply
// 1 - 2 * *self as i8
// B: Shift
// 1 - ((*self as i8) << 1)

// C: Shift
1 - ((*self as i8) << 1)
// C: Bitwise
// (*self as i8 ^ 1) - (*self as i8 & 1)
}

/// Returns this [`Color`]'s opposite / inverse / enemy.
Expand Down

0 comments on commit 249bd82

Please sign in to comment.