From: Ian Jackson Date: Wed, 28 Apr 2021 23:54:25 +0000 (+0100) Subject: cmdlistener: Move handling of expand X-Git-Tag: otter-0.6.0~502 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=b372b992a20210e2531cd9e8b535d20699c15aa9;p=otter.git cmdlistener: Move handling of expand We're going to want this to interact with resp Signed-off-by: Ian Jackson --- diff --git a/daemon/cmdlistener.rs b/daemon/cmdlistener.rs index f6744340..41010c0f 100644 --- a/daemon/cmdlistener.rs +++ b/daemon/cmdlistener.rs @@ -970,11 +970,6 @@ fn execute_for_game<'cs, 'igr, 'ig: 'igr>( let (updates, resp, unprepared, expand, ig) = execute_game_insn(cs, ag, igu, insn, &who, &mut to_permute)?; - if ! expand.is_empty() { - let mut expand: VecDeque<_> = expand.into(); - expand.append(&mut insns); - insns = expand; - } let st = uh_auth.get_or_insert_with(||{ let auth = Authorisation::authorised(&*ig.name); let uh = UpdateHandler::from_how(how); @@ -982,6 +977,11 @@ fn execute_for_game<'cs, 'igr, 'ig: 'igr>( }); st.have_deleted |= was_delete; st.uh.accumulate(ig, updates)?; + if ! expand.is_empty() { + let mut expand: VecDeque<_> = expand.into(); + expand.append(&mut insns); + insns = expand; + } responses.push(resp); if let Some(unprepared) = unprepared { st.flush(ig,how,&who)?;