From: Isaku Yamahata Date: Tue, 28 Aug 2012 17:19:00 +0000 (+0900) Subject: lib/ofp-actions: improve ofpact_instruction_name_from_type() X-Git-Tag: sliver-openvswitch-1.8.90-0~48^2~15 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=6ae0fd547b96e501ad105b1fc51113bacddc56d5 lib/ofp-actions: improve ofpact_instruction_name_from_type() eliminate unnecessary loop. Signed-off-by: Isaku Yamahata Signed-off-by: Ben Pfaff --- diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index 0e8b9dac4..baa6fdd7f 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -770,13 +770,7 @@ OVS_INSTRUCTIONS const char * ofpact_instruction_name_from_type(enum ovs_instruction_type type) { - const struct instruction_type_info *p; - for (p = inst_info; p < &inst_info[ARRAY_SIZE(inst_info)]; p++) { - if (p->type == type) { - return p->name; - } - } - return NULL; + return inst_info[type].name; } int