mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Do not use ParallelIterator if not using rayon
This commit is contained in:
parent
6fced22e47
commit
9af545e4e4
1 changed files with 9 additions and 2 deletions
|
@ -134,20 +134,27 @@ impl BlockContainer {
|
|||
),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub(super) fn inline_content_sizes(
|
||||
&self,
|
||||
layout_context: &LayoutContext,
|
||||
writing_mode: WritingMode,
|
||||
) -> ContentSizes {
|
||||
match &self {
|
||||
Self::BlockLevelBoxes(boxes) => boxes
|
||||
Self::BlockLevelBoxes(boxes) if layout_context.use_rayon => boxes
|
||||
.par_iter()
|
||||
.map(|box_| {
|
||||
box_.borrow_mut()
|
||||
.inline_content_sizes(layout_context, writing_mode)
|
||||
})
|
||||
.reduce(ContentSizes::zero, ContentSizes::max),
|
||||
Self::BlockLevelBoxes(boxes) => boxes
|
||||
.iter()
|
||||
.map(|box_| {
|
||||
box_.borrow_mut()
|
||||
.inline_content_sizes(layout_context, writing_mode)
|
||||
})
|
||||
.reduce(ContentSizes::max).unwrap_or_else(ContentSizes::zero),
|
||||
Self::InlineFormattingContext(context) => {
|
||||
context.inline_content_sizes(layout_context, writing_mode)
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue