From: Ben Pfaff Date: Wed, 30 Nov 2011 18:43:59 +0000 (-0800) Subject: ovsdb-data: Short-circuit ovsdb_datum_includes_all() in trivial case. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca261b65354f522ba43c823221763ca6f4604e2d;p=openvswitch ovsdb-data: Short-circuit ovsdb_datum_includes_all() in trivial case. Signed-off-by: Ben Pfaff --- diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c index 17818119..bb8781c2 100644 --- a/lib/ovsdb-data.c +++ b/lib/ovsdb-data.c @@ -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;