Re: [hackers] [sbase] [PATCH] join: Use LIMIT macro

From: Dimitris Papastamos <sin_AT_2f30.org>
Date: Thu, 23 Jul 2015 11:51:36 +0100

On Wed, Jul 22, 2015 at 01:36:37PM -0400, Wolfgang Corcoran-Mathe wrote:
> ---
> join.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/join.c b/join.c
> index 1f2fb8c..ddccdf1 100644
> --- a/join.c
> +++ b/join.c
> _AT_@ -173,10 +173,7 @@ linecmp(struct line *la, struct line *lb, size_t jfa, size_t jfb)
> } else {
> status = memcmp(la->fields[jfa].s, lb->fields[jfb].s,
> MAX (la->fields[jfa].len, lb->fields[jfb].len));
> - if (status > 0)
> - status = 1;
> - else if (status < 0)
> - status = -1;
> + LIMIT(status, -1, 1);
> }
>
> return status;

Applied, thanks :)
Received on Thu Jul 23 2015 - 12:51:36 CEST

This archive was generated by hypermail 2.3.0 : Thu Jul 23 2015 - 13:00:17 CEST