From d4c4f20a4585d6c7facfdbe6699c68cb5f56bc47 Mon Sep 17 00:00:00 2001 From: Max Vetrov Date: Sun, 17 Jun 2018 21:25:51 +0200 Subject: [PATCH] Update sort.c Redundant second if, and we may use "not" operation for bool, I suppose it's faster. --- src/sort.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/sort.c b/src/sort.c index 7ddd37d95..7feae9206 100644 --- a/src/sort.c +++ b/src/sort.c @@ -447,7 +447,7 @@ void sortCommand(client *c) { serverAssertWithInfo(c,sortval,j == vectorlen); /* Now it's time to load the right scores in the sorting vector */ - if (dontsort == 0) { + if (!dontsort) { for (j = 0; j < vectorlen; j++) { robj *byval; if (sortby) { @@ -487,9 +487,7 @@ void sortCommand(client *c) { decrRefCount(byval); } } - } - if (dontsort == 0) { server.sort_desc = desc; server.sort_alpha = alpha; server.sort_bypattern = sortby ? 1 : 0; -- GitLab