chiark / gitweb /
cmdlistener: Move handling of expand
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 28 Apr 2021 23:54:25 +0000 (00:54 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 28 Apr 2021 23:54:29 +0000 (00:54 +0100)
We're going to want this to interact with resp

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

index f6744340f123944e40dd9d80b165047ae1de98ee..41010c0f72f45cb48e18692d8f1140a0be2be4df 100644 (file)
@@ -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)?;