forked from M-Labs/nalgebra
Use #[inline] to improve opt-level 1 performance
This commit is contained in:
parent
2aff922ac8
commit
84c44984b1
@ -252,14 +252,17 @@ pub trait ToTypenum {
|
||||
}
|
||||
|
||||
unsafe impl<const T: usize> Dim for Const<T> {
|
||||
#[inline]
|
||||
fn try_to_usize() -> Option<usize> {
|
||||
Some(T)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn value(&self) -> usize {
|
||||
T
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn from_usize(dim: usize) -> Self {
|
||||
assert_eq!(dim, T);
|
||||
Self
|
||||
|
Loading…
Reference in New Issue
Block a user