From: Ben Pfaff <blp@nicira.com>
Date: Tue, 10 Nov 2009 23:31:03 +0000 (-0800)
Subject: svec: New function svec_is_empty().
X-Git-Tag: v1.0.0~259^2~509
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8ecd53084ce42e2e868a9c24c57b2d9a7e59cfc2;p=sliver-openvswitch.git

svec: New function svec_is_empty().
---

diff --git a/lib/svec.c b/lib/svec.c
index 078b10704..81a36b57a 100644
--- a/lib/svec.c
+++ b/lib/svec.c
@@ -59,6 +59,12 @@ svec_clear(struct svec *svec)
     svec->n = 0;
 }
 
+bool
+svec_is_empty(const struct svec *svec)
+{
+    return svec->n == 0;
+}
+
 void
 svec_add(struct svec *svec, const char *name)
 {
diff --git a/lib/svec.h b/lib/svec.h
index e1736bc6c..ff5619732 100644
--- a/lib/svec.h
+++ b/lib/svec.h
@@ -32,6 +32,7 @@ void svec_init(struct svec *);
 void svec_clone(struct svec *, const struct svec *);
 void svec_destroy(struct svec *);
 void svec_clear(struct svec *);
+bool svec_is_empty(const struct svec *);
 void svec_add(struct svec *, const char *);
 void svec_add_nocopy(struct svec *, char *);
 void svec_del(struct svec *, const char *);