Optimize salsa some more

This commit is contained in:
Lukas Wirth 2024-02-22 21:13:52 +01:00
parent f89d17b426
commit cc4d0e1bd1
13 changed files with 146 additions and 147 deletions

View file

@ -42,9 +42,9 @@ impl Durability {
pub(crate) const MAX: Durability = Self::HIGH;
/// Number of durability levels.
pub(crate) const LEN: usize = 3;
pub(crate) const LEN: usize = Self::MAX.index() + 1;
pub(crate) fn index(self) -> usize {
pub(crate) const fn index(self) -> usize {
self.0 as usize
}
}