From: Ian Jackson Date: Sun, 28 Feb 2021 17:04:07 +0000 (+0000) Subject: updates: Use idmap.fwd X-Git-Tag: otter-0.4.0~267 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=efad792f6105c5ca057f10b492623f58375c8c0a;p=otter.git updates: Use idmap.fwd If there is no fwd id then don't send an update. Bit odd, but whatever. Signed-off-by: Ian Jackson --- diff --git a/src/updates.rs b/src/updates.rs index 20a9e54a..b6aa823e 100644 --- a/src/updates.rs +++ b/src/updates.rs @@ -552,11 +552,13 @@ impl<'r> PrepareUpdatesBuffer<'r> { &mut gs.max_z, gpc, p, ops, &pri )? } - _ => Some(PreparedPieceUpdate { - // The piece is deleted, so we can't leak anything. - piece: gpl.idmap.fwd_or_insert(piece), - op: PieceUpdateOp::Delete(), - }) + _ => gpl.idmap.fwd(piece).map( + |vpid| PreparedPieceUpdate { + // The piece is deleted, so we can't leak anything. + piece: vpid, + op: PieceUpdateOp::Delete(), + } + ) }; if let Some(op) = op {