lib/ofp-actions: improve ofpact_instruction_name_from_type()
[sliver-openvswitch.git] / lib / ofp-actions.c
index db603b6..baa6fdd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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