Skip to content

Commit 90ea9c2

Browse files
committed
Add inlining
1 parent b99d257 commit 90ea9c2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/elliptic.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,34 @@ macro_rules! declare_method {
1111
// With @first, define_method expect self as the first argument.
1212
macro_rules! define_method {
1313
(@kc $name:ident -> $backend:ident($($argument:ident),*)) => {
14+
#[inline]
1415
fn $name(self, $($argument: Self,)*) -> Self {
1516
debug_assert!(self > 0.0, concat!("m (self) cannot be less than 1"));
1617
ellip::$name((1.0 - self).sqrt(), $($argument,)*).unwrap()
1718
}
1819
};
1920
(@kc_x $name:ident -> $backend:ident($x:ident)) => {
21+
#[inline]
2022
fn $name(self, $x: Self) -> Self {
2123
debug_assert!(self > 0.0, concat!("m (self) cannot be less than 1"));
2224
ellip::$name($x, (1.0 - self).sqrt()).unwrap()
2325
}
2426
};
2527
(@kc_x $name:ident -> $backend:ident($x:ident, $($argument:ident),+)) => {
28+
#[inline]
2629
fn $name(self, $x: Self, $($argument: Self,)*) -> Self {
2730
debug_assert!(self > 0.0, concat!("m (self) cannot be less than 1"));
2831
ellip::$name($x, (1.0 - self).sqrt(), $($argument,)*).unwrap()
2932
}
3033
};
3134
(@first $name:ident -> $backend:ident($($argument:ident),*)) => {
35+
#[inline]
3236
fn $name(self, $($argument: Self,)*) -> Self {
3337
ellip::$name(self, $($argument,)*).unwrap()
3438
}
3539
};
3640
($name:ident -> $backend:ident($($argument:ident),*)) => {
41+
#[inline]
3742
fn $name(self, $($argument: Self,)*) -> Self {
3843
ellip::$name($($argument,)* self).unwrap()
3944
}

0 commit comments

Comments
 (0)