]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix Event.signal
authorfennecdjay <fennecdjay@gmail.com>
Fri, 18 Nov 2022 10:56:03 +0000 (11:56 +0100)
committerfennecdjay <fennecdjay@gmail.com>
Fri, 18 Nov 2022 10:56:03 +0000 (11:56 +0100)
src/lib/event.c

index eb7fe5112009497a7d5c7d50c7eba5d754f329bb..c21d3b9d7ade819218752665f870816bbb0d2474 100644 (file)
@@ -31,12 +31,11 @@ static INSTR(EventWait) {
 
 static MFUN(event_signal) {
   const Vector   v  = &EV_SHREDS(o);
-  const VM_Shred sh = (VM_Shred)vector_front(v);
-  if (sh) {
-    shredule(sh->tick->shreduler, sh, GWION_EPSILON);
-    vector_rem(v, 0);
-    release(sh->info->me, sh);
-  }
+  if(!vector_size(v)) return;
+  const VM_Shred sh = vector_front(v);
+  shredule(sh->tick->shreduler, sh, GWION_EPSILON);
+  vector_rem(v, 0);
+  release(sh->info->me, sh);
 }
 
 ANN void broadcast(const M_Object o) {