optimize has_following_sibling
This commit is contained in:
parent
d14e6bd9f7
commit
ae88b3ed24
@ -129,13 +129,8 @@ impl CssTree {
|
|||||||
|
|
||||||
let parent_children = self.parent_to_child.get(parent_idx).unwrap();
|
let parent_children = self.parent_to_child.get(parent_idx).unwrap();
|
||||||
|
|
||||||
let child_pos = parent_children
|
// todo: we shouldn't take into account children that are invisible
|
||||||
.iter()
|
parent_children.last() != Some(&child)
|
||||||
.position(|child_idx| *child_idx == child)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
// todo: parent_children[child_pos + 1..] !is_invisible
|
|
||||||
child_pos + 1 < parent_children.len()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_stmt(&mut self, child: CssStmt, parent: Option<CssTreeIdx>) -> CssTreeIdx {
|
pub fn add_stmt(&mut self, child: CssStmt, parent: Option<CssTreeIdx>) -> CssTreeIdx {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user