mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Upgrade rayon_croissant to 0.2.0
This commit is contained in:
parent
9edda952c9
commit
1c8d14ac0d
4 changed files with 19 additions and 18 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -4221,9 +4221,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "rayon_croissant"
|
||||
version = "0.1.1"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b725e815f3aa08718063883a75003336889debafe2f8fa67fbe91563ddc4efa"
|
||||
checksum = "3e4aafda434bd10fec689858e2b1d713d0b784b1e60df3761ac8fa727d7e8e27"
|
||||
dependencies = [
|
||||
"moite_moite",
|
||||
"rayon",
|
||||
|
|
|
@ -25,7 +25,7 @@ msg = {path = "../msg"}
|
|||
net_traits = {path = "../net_traits"}
|
||||
range = {path = "../range"}
|
||||
rayon = "1"
|
||||
rayon_croissant = "0.1.1"
|
||||
rayon_croissant = "0.2.0"
|
||||
script_layout_interface = {path = "../script_layout_interface"}
|
||||
script_traits = {path = "../script_traits"}
|
||||
serde = "1.0"
|
||||
|
|
|
@ -172,14 +172,6 @@ impl BlockContainer {
|
|||
contains_floats: ContainsFloats,
|
||||
outer_content_sizes_of_children: ContentSizes,
|
||||
}
|
||||
impl Default for Accumulator {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
contains_floats: ContainsFloats::No,
|
||||
outer_content_sizes_of_children: ContentSizes::zero(),
|
||||
}
|
||||
}
|
||||
}
|
||||
let mut acc = Accumulator {
|
||||
contains_floats: builder.contains_floats,
|
||||
outer_content_sizes_of_children: ContentSizes::zero(),
|
||||
|
@ -199,13 +191,21 @@ impl BlockContainer {
|
|||
builder
|
||||
.block_level_boxes
|
||||
.into_par_iter()
|
||||
.mapfold_reduce_into(&mut acc, mapfold, |left, right| {
|
||||
left.contains_floats |= right.contains_floats;
|
||||
if content_sizes.requests_inline() {
|
||||
left.outer_content_sizes_of_children
|
||||
.max_assign(&right.outer_content_sizes_of_children)
|
||||
}
|
||||
})
|
||||
.mapfold_reduce_into(
|
||||
&mut acc,
|
||||
mapfold,
|
||||
|| Accumulator {
|
||||
contains_floats: ContainsFloats::No,
|
||||
outer_content_sizes_of_children: ContentSizes::zero(),
|
||||
},
|
||||
|left, right| {
|
||||
left.contains_floats |= right.contains_floats;
|
||||
if content_sizes.requests_inline() {
|
||||
left.outer_content_sizes_of_children
|
||||
.max_assign(&right.outer_content_sizes_of_children)
|
||||
}
|
||||
},
|
||||
)
|
||||
.collect()
|
||||
} else {
|
||||
builder
|
||||
|
|
|
@ -235,6 +235,7 @@ fn layout_block_level_children<'a>(
|
|||
/* float_context = */ None,
|
||||
)
|
||||
},
|
||||
Default::default,
|
||||
|left, right| left.append(right),
|
||||
)
|
||||
.collect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue