[hackers] [sbase] join: Use LIMIT macro || Wolfgang Corcoran-Mathe

From: <git_AT_suckless.org>
Date: Thu, 23 Jul 2015 12:51:10 +0200 (CEST)

commit 625f421f5ac1429991e7d2e028a7a97cbe14237c
Author: Wolfgang Corcoran-Mathe <first.lord.of.teal_AT_gmail.com>
AuthorDate: Wed Jul 22 13:36:37 2015 -0400
Commit: sin <sin_AT_2f30.org>
CommitDate: Thu Jul 23 11:51:05 2015 +0100

    join: Use LIMIT macro

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;
Received on Thu Jul 23 2015 - 12:51:10 CEST

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