-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Description
There are many trivial methods in the code that should be inlined (which will help compiler to generate better code).
Especially in cases like this:
parity-scale-codec/src/codec.rs
Lines 1545 to 1547 in 0a0295a
| fn encoded_fixed_size() -> Option<usize> { | |
| Some(mem::size_of::<$t>()) | |
| } |
This is essentially a const method, #[inline(force)] it will reduce the call and corresponding .unwrap() to a constant.
I wanted to submit such a change, but turned out code has a huge number of trivial methods and I wasn't in a mood to do invasive changes.
Metadata
Metadata
Assignees
Labels
No labels