cleanup: Replace ir_nodeset_contains() + ir_nodeset_insert() by just the latter.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sun, 16 Dec 2012 20:19:52 +0000 (21:19 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sun, 16 Dec 2012 20:19:52 +0000 (21:19 +0100)
ir/lower/lower_alloc.c
ir/lower/lower_switch.c

index c0c15d3..3a5dc5a 100644 (file)
@@ -121,10 +121,9 @@ static void lower_alloca_free(ir_node *node, void *data)
        } else {
                return;
        }
-       if (ir_nodeset_contains(&transformed, node))
+       if (!ir_nodeset_insert(&transformed, node))
                return;
 
-       ir_nodeset_insert(&transformed, node);
        size = get_type_size_bytes(type);
        if (is_unknown_type(type))
                size = 1;
index e5f3744..880d28b 100644 (file)
@@ -423,9 +423,8 @@ static void find_switch_nodes(ir_node *block, void *ctx)
        if (!is_Switch(switchn))
                return;
 
-       if (ir_nodeset_contains(&env->processed, switchn))
+       if (!ir_nodeset_insert(&env->processed, switchn))
                return;
-       ir_nodeset_insert(&env->processed, switchn);
 
        analyse_switch0(&info, switchn);