summaryrefslogtreecommitdiff
path: root/lib/ovsdb-data.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-01-31 11:23:24 -0800
committerBen Pfaff <blp@ovn.org>2018-02-01 11:21:34 -0800
commit500db308e2704fa9fc5ff69cdcd9cb3b22116e99 (patch)
tree8a5cf13bf33232372b806bcbd48c791add83a4df /lib/ovsdb-data.c
parent4bc938ccb3124282c873084a7d11cd8bc37e27a7 (diff)
downloadopenvswitch-500db308e2704fa9fc5ff69cdcd9cb3b22116e99.tar.gz
util: Document and rely on ovs_assert() always evaluating its argument.
The ovs_assert() macro always evaluates its argument, even when NDEBUG is defined so that failure is ignored. This behavior wasn't documented, and thus a lot of code didn't rely on it. This commit documents the behavior and simplifies bits of code that heretofore didn't rely on it. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Diffstat (limited to 'lib/ovsdb-data.c')
-rw-r--r--lib/ovsdb-data.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
index 87d8effd1..0c9945cd1 100644
--- a/lib/ovsdb-data.c
+++ b/lib/ovsdb-data.c
@@ -1948,10 +1948,8 @@ ovsdb_datum_union(struct ovsdb_datum *a, const struct ovsdb_datum *b,
}
}
if (n != a->n) {
- struct ovsdb_error *error;
a->n = n;
- error = ovsdb_datum_sort(a, type->key.type);
- ovs_assert(!error);
+ ovs_assert(!ovsdb_datum_sort(a, type->key.type));
}
}