From 76d39421636e248a621040b4606ae0db07348636 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 7 Feb 2007 01:53:18 +0000 Subject: [PATCH] speed up iteration --- ir/be/ia32/ia32_gen_decls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ir/be/ia32/ia32_gen_decls.c b/ir/be/ia32/ia32_gen_decls.c index ef133cc75..0e334dd91 100644 --- a/ir/be/ia32/ia32_gen_decls.c +++ b/ir/be/ia32/ia32_gen_decls.c @@ -384,7 +384,7 @@ static void dump_compound_init(obstack_t *obst, ir_entity *ent) ir_type *ty = get_entity_type(ent); normal_or_bitfield *vals; int type_size; - int i, j; + int i, j, n; /* * in the worst case, every entity allocates one byte, so the type @@ -395,7 +395,7 @@ static void dump_compound_init(obstack_t *obst, ir_entity *ent) memset(vals, 0, type_size * sizeof(vals[0])); /* collect the values and store them at the offsets */ - for(i = 0; i < get_compound_ent_n_values(ent); ++i) { + for(i = 0, n = get_compound_ent_n_values(ent); i < n; ++i) { const compound_graph_path *path = get_compound_ent_value_path(ent, i); int path_len = get_compound_graph_path_length(path); int offset = get_compound_ent_value_offset_bytes(ent, i); -- 2.20.1