From efad792f6105c5ca057f10b492623f58375c8c0a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 28 Feb 2021 17:04:07 +0000 Subject: [PATCH] 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 --- src/updates.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 { -- 2.30.2