From a48f785ad0e235f5b504575203d743c364e27194 Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 29 May 2022 19:23:16 -0400 Subject: [PATCH] mark some methods as inline this probably doesn't really matter, as i understand it rust inlines a hell of a lot of stuff, especially for method calls from within the same crate ... --- libretrogd/src/audio/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libretrogd/src/audio/mod.rs b/libretrogd/src/audio/mod.rs index 9ba7283..6a7a0b4 100644 --- a/libretrogd/src/audio/mod.rs +++ b/libretrogd/src/audio/mod.rs @@ -82,6 +82,7 @@ impl AudioChannel { } } + #[inline] fn data_at(&mut self, position: usize) -> Option { if let Some(generator) = &mut self.generator { generator.gen_sample(position) @@ -152,6 +153,7 @@ impl AudioChannel { self.loops = loops; } + #[inline] pub fn play_generator(&mut self, generator: impl AudioGenerator + 'static, loops: bool) { self.data.clear(); self.generator = Some(Box::new(generator)); @@ -160,6 +162,7 @@ impl AudioChannel { self.loops = loops; } + #[inline] pub fn is_playable(&self) -> bool { !self.data.is_empty() || self.generator.is_some() }