[ovs-dev] [PATCH 1/2] ovsdb-data: Short-circuit ovsdb_datum_includes_all() in trivial case.

Ben Pfaff blp at nicira.com
Wed Jan 11 16:22:47 UTC 2012


Right, in fact both 'a' and 'b' must be in sorted order, as specified by
the invariants documented for ovsdb_datum.

I don't remember why I was looking at this (it's over a month old).  It
wasn't a performance problem.

On Tue, Jan 10, 2012 at 05:33:10PM -0800, Ethan Jackson wrote:
> I'm assuming that the same element can't be in 'a' twice.
> 
> What prompted this? Was it causing a performance problem, or did you
> notice it by inspection?
> 
> Ethan
> 
> On Wed, Nov 30, 2011 at 10:45, Ben Pfaff <blp at nicira.com> wrote:
> > ---
> > ?lib/ovsdb-data.c | ? ?3 +++
> > ?1 files changed, 3 insertions(+), 0 deletions(-)
> >
> > diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
> > index 1781811..bb8781c 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;
> > --
> > 1.7.2.5
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list