mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Inline some things that should never ever appear in a profile.
This commit is contained in:
parent
9da7663e29
commit
2bbeda97d3
3 changed files with 13 additions and 5 deletions
|
@ -91,7 +91,7 @@ pub struct DeclarationImportanceIterator<'a> {
|
|||
}
|
||||
|
||||
impl<'a> DeclarationImportanceIterator<'a> {
|
||||
/// Constructor
|
||||
/// Constructor.
|
||||
pub fn new(declarations: &'a [PropertyDeclaration], important: &'a SmallBitVec) -> Self {
|
||||
DeclarationImportanceIterator {
|
||||
iter: declarations.iter().zip(important.iter()),
|
||||
|
@ -102,17 +102,20 @@ impl<'a> DeclarationImportanceIterator<'a> {
|
|||
impl<'a> Iterator for DeclarationImportanceIterator<'a> {
|
||||
type Item = (&'a PropertyDeclaration, Importance);
|
||||
|
||||
#[inline]
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
self.iter.next().map(|(decl, important)|
|
||||
(decl, if important { Importance::Important } else { Importance::Normal }))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
self.iter.size_hint()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> DoubleEndedIterator for DeclarationImportanceIterator<'a> {
|
||||
#[inline(always)]
|
||||
fn next_back(&mut self) -> Option<Self::Item> {
|
||||
self.iter.next_back().map(|(decl, important)|
|
||||
(decl, if important { Importance::Important } else { Importance::Normal }))
|
||||
|
@ -123,7 +126,8 @@ impl<'a> DoubleEndedIterator for DeclarationImportanceIterator<'a> {
|
|||
pub struct NormalDeclarationIterator<'a>(DeclarationImportanceIterator<'a>);
|
||||
|
||||
impl<'a> NormalDeclarationIterator<'a> {
|
||||
/// Constructor
|
||||
/// Constructor.
|
||||
#[inline]
|
||||
pub fn new(declarations: &'a [PropertyDeclaration], important: &'a SmallBitVec) -> Self {
|
||||
NormalDeclarationIterator(
|
||||
DeclarationImportanceIterator::new(declarations, important)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue