trigger: reduce indentation level in trigger_event()
authorFelix Fietkau <nbd@nbd.name>
Fri, 29 Jul 2016 09:04:30 +0000 (11:04 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 29 Jul 2016 09:04:30 +0000 (11:04 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
service/trigger.c

index 216e1f2f00f7191e700f24c7612a3517e30b1f94..4cfea316f2af4b7e5e5c4c241bff230db94a0c2d 100644 (file)
@@ -338,14 +338,14 @@ void trigger_event(const char *type, struct blob_attr *data)
        list_for_each_entry(t, &triggers, list) {
                if (t->remove)
                        continue;
-               if (trigger_match(type, t->type)) {
-                       if (t->timeout) {
-                               free(t->data);
-                               t->data = blob_memdup(data);
-                               uloop_timeout_set(&t->delay, t->timeout);
-                       } else {
-                               json_script_run(&t->jctx, t->type, data);
-                       }
+               if (!trigger_match(type, t->type))
+                       continue;
+               if (t->timeout) {
+                       free(t->data);
+                       t->data = blob_memdup(data);
+                       uloop_timeout_set(&t->delay, t->timeout);
+               } else {
+                       json_script_run(&t->jctx, t->type, data);
                }
        }
 }