Add an inline hint on Generator::next().

This improves the generate benchmark by about 1ns.
This commit is contained in:
whitequark 2016-07-17 05:07:08 +00:00 committed by edef
parent 16c674b4f4
commit 15d2fbaf51
1 changed files with 1 additions and 0 deletions

View File

@ -167,6 +167,7 @@ impl<Item, Stack> Iterator for Generator<Item, Stack>
/// Resumes the generator and return the next value it yields.
/// If the generator function has returned, returns `None`.
#[inline]
fn next(&mut self) -> Option<Self::Item> {
match self.state {
State::Suspended => {