[board] Inline BitAnd, BitOr, and Not BitBoard methods; remove an unused import

This commit is contained in:
Eryn Wells 2023-12-23 09:17:07 -07:00
parent 0838f4fd01
commit 70d8034e4e

View file

@ -1,7 +1,6 @@
// Eryn Wells <eryn@erynwells.me>
use crate::square::Square;
use std::arch::asm;
use std::ops::{BitAnd, BitOr, Not};
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
@ -50,6 +49,7 @@ impl BitBoard {
impl BitAnd for BitBoard {
type Output = BitBoard;
#[inline]
fn bitand(self, rhs: Self) -> Self {
BitBoard(self.0 & rhs.0)
}
@ -58,6 +58,7 @@ impl BitAnd for BitBoard {
impl BitAnd<&BitBoard> for BitBoard {
type Output = BitBoard;
#[inline]
fn bitand(self, rhs: &Self) -> Self {
BitBoard(self.0 & rhs.0)
}
@ -93,6 +94,7 @@ impl BitOr for BitBoard {
impl BitOr<&BitBoard> for BitBoard {
type Output = BitBoard;
#[inline]
fn bitor(self, rhs: &Self) -> Self {
BitBoard(self.0 | rhs.0)
}