Skip to content

Commit

Permalink
Inline some encoding and decoding methods.
Browse files Browse the repository at this point in the history
This is a small performance win.
  • Loading branch information
nnethercote committed Feb 19, 2020
1 parent 5e7af46 commit 139c3ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc/ty/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ where
macro_rules! __impl_decoder_methods {
($($name:ident -> $ty:ty;)*) => {
$(
#[inline]
fn $name(&mut self) -> Result<$ty, Self::Error> {
self.opaque.$name()
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc/ty/query/on_disk_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ where

macro_rules! encoder_methods {
($($name:ident($ty:ty);)*) => {
#[inline]
$(fn $name(&mut self, value: $ty) -> Result<(), Self::Error> {
self.encoder.$name(value)
})*
Expand Down

0 comments on commit 139c3ca

Please sign in to comment.