Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #[cold] to QueryIter::next_archetype #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@
/// Advance query to the next archetype
///
/// Outlined from `Iterator::next` for improved iteration performance.
#[cold]
fn next_archetype(&mut self) -> Option<()> {
let archetype = self.archetypes.next()?;
let archetype = unsafe { self.world.archetypes_inner().get_unchecked(archetype) };
Expand Down Expand Up @@ -1238,12 +1239,12 @@

/// Execute the prepared query
// The lifetime narrowing here is required for soundness.
pub fn iter<'i>(&'i mut self) -> PreparedQueryIter<'i, Q> {

Check failure on line 1242 in src/query.rs

View workflow job for this annotation

GitHub Actions / lint

the following explicit lifetimes could be elided: 'i
unsafe { PreparedQueryIter::new(self.meta, self.archetypes, self.state.iter()) }
}

/// Provides random access to the results of the prepared query
pub fn view<'i>(&'i mut self) -> PreparedView<'i, Q> {

Check failure on line 1247 in src/query.rs

View workflow job for this annotation

GitHub Actions / lint

the following explicit lifetimes could be elided: 'i
unsafe { PreparedView::new(self.meta, self.archetypes, self.state.iter(), self.fetch) }
}
}
Expand Down
Loading