mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Update to smallbitvec 2.1
This commit is contained in:
parent
5081755418
commit
e3f79d9130
5 changed files with 20 additions and 21 deletions
|
@ -313,7 +313,7 @@ impl PropertyDeclarationBlock {
|
|||
}
|
||||
|
||||
self.declarations.iter().enumerate().find(|&(_, decl)| decl.id() == property).map(|(i, decl)| {
|
||||
let importance = if self.declarations_importance.get(i as u32) {
|
||||
let importance = if self.declarations_importance[i] {
|
||||
Importance::Important
|
||||
} else {
|
||||
Importance::Normal
|
||||
|
@ -517,7 +517,7 @@ impl PropertyDeclarationBlock {
|
|||
continue;
|
||||
}
|
||||
|
||||
let important = self.declarations_importance.get(i as u32);
|
||||
let important = self.declarations_importance[i];
|
||||
// For declarations from parsing, non-important declarations
|
||||
// shouldn't override existing important one.
|
||||
if important && !importance.important() &&
|
||||
|
@ -549,7 +549,7 @@ impl PropertyDeclarationBlock {
|
|||
|
||||
if let Some(index) = index_to_remove {
|
||||
self.declarations.remove(index);
|
||||
self.declarations_importance.remove(index as u32);
|
||||
self.declarations_importance.remove(index);
|
||||
self.declarations.push(declaration);
|
||||
self.declarations_importance.push(importance.important());
|
||||
return true;
|
||||
|
@ -572,8 +572,8 @@ impl PropertyDeclarationBlock {
|
|||
for (i, declaration) in self.declarations.iter().enumerate() {
|
||||
if declaration.id().is_or_is_longhand_of(property) {
|
||||
let is_important = new_importance.important();
|
||||
if self.declarations_importance.get(i as u32) != is_important {
|
||||
self.declarations_importance.set(i as u32, is_important);
|
||||
if self.declarations_importance[i] != is_important {
|
||||
self.declarations_importance.set(i, is_important);
|
||||
updated_at_least_one = true;
|
||||
}
|
||||
}
|
||||
|
@ -686,7 +686,7 @@ impl PropertyDeclarationBlock {
|
|||
PropertyDeclarationBlock {
|
||||
declarations,
|
||||
longhands,
|
||||
declarations_importance: SmallBitVec::from_elem(len as u32, false),
|
||||
declarations_importance: SmallBitVec::from_elem(len, false),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue