eliminate unnecessary loop.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
const char *
ofpact_instruction_name_from_type(enum ovs_instruction_type type)
{
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;