mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Auto merge of #6445 - mbrubeck:next_fragment, r=pcwalton
Simplify next_fragment and fix obsolete docs r? @pcwalton <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6445) <!-- Reviewable:end -->
This commit is contained in:
commit
d86c587925
1 changed files with 1 additions and 12 deletions
|
@ -301,22 +301,11 @@ impl LineBreaker {
|
|||
}
|
||||
|
||||
/// Acquires a new fragment to lay out from the work list or fragment list as appropriate.
|
||||
/// If the fragment was at the end of an old line, undoes the line break for that fragment.
|
||||
/// Note that you probably don't want to call this method directly in order to be incremental-
|
||||
/// reflow-safe; try `next_unbroken_fragment` instead.
|
||||
fn next_fragment<I>(&mut self, old_fragment_iter: &mut I) -> Option<Fragment>
|
||||
where I: Iterator<Item=Fragment> {
|
||||
let mut fragment;
|
||||
if self.work_list.is_empty() {
|
||||
match old_fragment_iter.next() {
|
||||
None => return None,
|
||||
Some(this_fragment) => fragment = this_fragment,
|
||||
}
|
||||
} else {
|
||||
return self.work_list.pop_front()
|
||||
}
|
||||
|
||||
Some(fragment)
|
||||
self.work_list.pop_front().or_else(|| old_fragment_iter.next())
|
||||
}
|
||||
|
||||
/// Acquires a new fragment to lay out from the work list or fragment list, merging it with any
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue