py: Simplify bytecode prelude when encoding closed over variables.
diff --git a/py/bc.c b/py/bc.c
index af855e9..865065a 100644
--- a/py/bc.c
+++ b/py/bc.c
@@ -228,9 +228,10 @@
 
     // bytecode prelude: initialise closed over variables
     const byte *ip = code_state->ip;
-    for (mp_uint_t n_local = *ip++; n_local > 0; n_local--) {
-        mp_uint_t local_num = *ip++;
-        code_state->state[n_state - 1 - local_num] = mp_obj_new_cell(code_state->state[n_state - 1 - local_num]);
+    mp_uint_t local_num;
+    while ((local_num = *ip++) != 255) {
+        code_state->state[n_state - 1 - local_num] =
+            mp_obj_new_cell(code_state->state[n_state - 1 - local_num]);
     }
 
     // now that we skipped over the prelude, set the ip for the VM