On Sun, Apr 30, 2017 at 7:22 PM, Ben Pfaff <b...@ovn.org> wrote:
> This will have another caller in an upcoming commit.
>
> Signed-off-by: Ben Pfaff <b...@ovn.org>

Acked-by: Russell Bryant <russ...@ovn.org>

with a minor comment inline ...

> diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
> index ab617f9e065d..18109691b1d6 100644
> --- a/lib/db-ctl-base.c
> +++ b/lib/db-ctl-base.c
> @@ -300,14 +300,6 @@ get_row_by_id(struct ctl_context *ctx,
>      return final;
>  }
>
> -static bool
> -is_partial_uuid_match(const struct uuid *uuid, const char *match)
> -{
> -    char uuid_s[UUID_LEN + 1];
> -    snprintf(uuid_s, sizeof uuid_s, UUID_FMT, UUID_ARGS(uuid));
> -    return !strncmp(uuid_s, match, strlen(match));
> -}
> -
>  static const struct ovsdb_idl_row *
>  get_row(struct ctl_context *ctx,
>          const struct ovsdb_idl_table_class *table, const char *record_id,
> @@ -343,7 +335,7 @@ get_row(struct ctl_context *ctx,
>                                                                   table);
>               r != NULL;
>               r = ovsdb_idl_next_row(r)) {
> -            if (is_partial_uuid_match(&r->uuid, record_id)) {
> +            if (uuid_is_partial_match(&r->uuid, record_id) >= 4) {
>                  if (!row) {
>                      row = r;
>                  } else {

I'm not sure if the ">= 4" is valuable since there is an outer
conditional that ensures "record_id" is at least a 4 character long
partial UUID.  It doesn't seem harmful, either though ...
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to