mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +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
|
@ -141,13 +141,20 @@ impl BlockContainer {
|
||||||
writing_mode: WritingMode,
|
writing_mode: WritingMode,
|
||||||
) -> ContentSizes {
|
) -> ContentSizes {
|
||||||
match &self {
|
match &self {
|
||||||
Self::BlockLevelBoxes(boxes) => boxes
|
Self::BlockLevelBoxes(boxes) if layout_context.use_rayon => boxes
|
||||||
.par_iter()
|
.par_iter()
|
||||||
.map(|box_| {
|
.map(|box_| {
|
||||||
box_.borrow_mut()
|
box_.borrow_mut()
|
||||||
.inline_content_sizes(layout_context, writing_mode)
|
.inline_content_sizes(layout_context, writing_mode)
|
||||||
})
|
})
|
||||||
.reduce(ContentSizes::zero, ContentSizes::max),
|
.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) => {
|
Self::InlineFormattingContext(context) => {
|
||||||
context.inline_content_sizes(layout_context, writing_mode)
|
context.inline_content_sizes(layout_context, writing_mode)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue