chiark / gitweb /
fastsplit: Promote construction of ipc_from_record
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 20 May 2022 18:04:21 +0000 (19:04 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 20 May 2022 18:21:55 +0000 (19:21 +0100)
fs_record borrows from ig, so doing this sooner is helpful so we can
pass ig to complex recalculation code.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/fastsplit.rs

index 87d2b6daf7242d30067c8645be07d41331f27847..5b49269608412c6d90003962098b649a6efe381a 100644 (file)
@@ -140,14 +140,15 @@ impl InstanceGuard<'_> {
       &mut ngpc
     )?;
 
+    let ipc_from_record = fs_record.ipc.clone();
+
     // Committing.
 
     // This is outside the infallible closure because borrowck
     // can't see that we drop tgpc before doing stuff with ig.
     tpc_new_z.implement(tgpc);
     (||{
-      let nipc = IFastSplits::make_ipc(&mut ig.ioccults.ilks,
-                                       fs_record.ipc.clone());
+      let nipc = IFastSplits::make_ipc(&mut ig.ioccults.ilks, ipc_from_record);
       let npiece = ig.gs.pieces.as_mut(modperm).insert(ngpc);
       ig.ipieces.as_mut(modperm).insert(npiece, nipc);