ovsdb-data: Short-circuit ovsdb_datum_includes_all() in trivial case.
authorBen Pfaff <blp@nicira.com>
Wed, 30 Nov 2011 18:43:59 +0000 (10:43 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 11 Jan 2012 17:56:11 +0000 (09:56 -0800)
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ovsdb-data.c

index 1781811917d2ee04df5f190da7622df3073a8e91..bb8781c25d5c87dd4ef062af349fb88bf3f475a9 100644 (file)
@@ -1687,6 +1687,9 @@ ovsdb_datum_includes_all(const struct ovsdb_datum *a,
 {
     size_t i;
 
+    if (a->n > b->n) {
+        return false;
+    }
     for (i = 0; i < a->n; i++) {
         if (ovsdb_datum_find(a, i, b, type) == UINT_MAX) {
             return false;