Skip to content

Commit

Permalink
Auto merge of #69281 - nnethercote:inline-some-encoding-decoding-meth…
Browse files Browse the repository at this point in the history
…ods, r=Centril

Inline some encoding and decoding methods.

This is a small performance win.

r? @Centril
  • Loading branch information
bors committed Feb 21, 2020
2 parents d3ebd59 + 139c3ca commit 2851e59
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 2851e59

Please sign in to comment.