Skip to content

Commit 227124c

Browse files
committed
Merge more code
1 parent 5bb428f commit 227124c

1 file changed

Lines changed: 11 additions & 19 deletions

File tree

pineappl/src/grid.rs

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,28 +1293,20 @@ impl Grid {
12931293
}
12941294
}
12951295

1296-
// make sure we've evolved all slices
1297-
if let Some(fac1) = grid_scales1[0].iter().find(|&&grid_fac1| {
1298-
!op_scales1[0]
1296+
// make sure we've evolved all slices in the grid
1297+
for ((grid_scales1, op_scales1), name) in grid_scales1.iter().zip(&op_scales1).zip(&names) {
1298+
if let Some(scale1) = grid_scales1
12991299
.iter()
1300-
.any(|&eko_fac1| subgrid::node_value_eq(grid_fac1, eko_fac1))
1301-
}) {
1302-
return Err(Error::General(format!(
1303-
"no operator for fac1 = {fac1} found"
1304-
)));
1305-
}
1306-
1307-
// make sure we've evolved all slices
1308-
if let Some(frg1) = grid_scales1[1].iter().find(|&&grid_frg1| {
1309-
!op_scales1[1]
1310-
.iter()
1311-
.any(|&eko_frg1| subgrid::node_value_eq(grid_frg1, eko_frg1))
1312-
}) {
1313-
return Err(Error::General(format!(
1314-
"no operator for frg1 = {frg1} found"
1315-
)));
1300+
.find(|&&a| !op_scales1.iter().any(|&b| subgrid::node_value_eq(a, b)))
1301+
{
1302+
return Err(Error::General(format!(
1303+
"no operator for {name}1 = '{scale1}' found"
1304+
)));
1305+
}
13161306
}
13171307

1308+
// if we didn't actually perform an evolution an empty grid isn't guaranteed to be an
1309+
// FK-table
13181310
let result =
13191311
result.ok_or_else(|| Error::General("no evolution was performed".to_owned()))?;
13201312

0 commit comments

Comments
 (0)