mirror
This commit is contained in:
parent
494de58804
commit
5f1bc22797
1 changed files with 3 additions and 2 deletions
|
|
@ -213,7 +213,7 @@ impl Rank {
|
|||
|
||||
#[inline]
|
||||
pub fn mirror(self) -> Self {
|
||||
unsafe { Self::new_unchecked(7_u8.unchecked_sub(self as u8)) }
|
||||
unsafe { Self::new_unchecked(!(self as u8)) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
@ -305,7 +305,8 @@ impl Square {
|
|||
|
||||
#[inline]
|
||||
pub fn mirror(self) -> Self {
|
||||
Self::from_coords(self.file(), self.rank().mirror())
|
||||
let sq = self as u8;
|
||||
unsafe { Self::new_unchecked(sq & 0b000111 | (!sq & 0b111000)) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue