On Wed, Aug 26, 2015 at 12:34:07PM -0700, Andy Zhou wrote: > Acked-by: Andy Zhou <az...@nicira.com>
Thanks, I applied this to master. > A question in line. > > On Tue, Aug 25, 2015 at 9:37 PM, Ben Pfaff <b...@nicira.com> wrote: > > This will acquire its first user in an upcoming commit. > > > > Signed-off-by: Ben Pfaff <b...@nicira.com> > > --- > > lib/sset.c | 14 ++++++++++++++ > > lib/sset.h | 3 +++ > > 2 files changed, 17 insertions(+) > > > > diff --git a/lib/sset.c b/lib/sset.c > > index 33c4298..f9d4fc0 100644 > > --- a/lib/sset.c > > +++ b/lib/sset.c > > @@ -269,6 +269,20 @@ sset_at_position(const struct sset *set, uint32_t > > *bucketp, uint32_t *offsetp) > > return SSET_NODE_FROM_HMAP_NODE(hmap_node); > > } > > > > +/* Replaces 'a' by the intersection of 'a' and 'b'. That is, removes from > > 'a' > > + * all of the strings that are not also in 'b'. */ > > +void > > +sset_intersect(struct sset *a, const struct sset *b) > > +{ > > + const char *name, *next; > > + > > + SSET_FOR_EACH_SAFE (name, next, a) { > > + if (!sset_contains(b, name)) { > > + sset_delete(a, SSET_NODE_FROM_NAME(name)); > Why not use 'sset_find_and_delete()'? That would re-search the sset for 'name', but we already have a pointer to it via 'a'. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev