proto-shell: simplify no_proto_task assignment
authorFelix Fietkau <nbd@openwrt.org>
Sat, 23 May 2015 14:42:20 +0000 (16:42 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 23 May 2015 14:44:46 +0000 (16:44 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
proto-shell.c

index 50f1b5b..bac57e0 100644 (file)
@@ -821,10 +821,7 @@ proto_shell_add_handler(const char *script, const char *name, json_object *obj)
                handler->proto.flags |= PROTO_FLAG_NODEV;
 
        tmp = json_get_field(obj, "no-proto-task", json_type_boolean);
-       if (tmp && json_object_get_boolean(tmp))
-               handler->no_proto_task = true;
-       else
-               handler->no_proto_task = false;
+       handler->no_proto_task = tmp && json_object_get_boolean(tmp);
 
        tmp = json_get_field(obj, "available", json_type_boolean);
        if (tmp && json_object_get_boolean(tmp))