2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

lib/ofp-actions: improve ofpact_instruction_name_from_type()

eliminate unnecessary loop.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Isaku Yamahata
2012-08-29 02:19:00 +09:00
committed by Ben Pfaff
parent 0ceaa66c39
commit 6ae0fd547b

View File

@@ -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