Inline always in new_from_parts (#433)

Mentioned here that we should probably do it:
https://github.com/agbrs/agb/discussions/370#discussioncomment-4650702

From decompiling, it seems that this normally happens, but lets at least
ensure it if you don't have lto enabled.

- [x] no changelog update needed
This commit is contained in:
Corwin 2023-05-24 01:47:03 +01:00 committed by GitHub
commit 1b687b787d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -416,6 +416,7 @@ impl<I: FixedWidthUnsignedInteger, const N: usize> Num<I, N> {
} }
#[doc(hidden)] #[doc(hidden)]
#[inline(always)]
/// Called by the [num!] macro in order to create a fixed point number /// Called by the [num!] macro in order to create a fixed point number
pub fn new_from_parts(num: (i32, i32)) -> Self { pub fn new_from_parts(num: (i32, i32)) -> Self {
Self(I::from_as_i32(((num.0) << N) + (num.1 >> (30 - N)))) Self(I::from_as_i32(((num.0) << N) + (num.1 >> (30 - N))))