diff options
author | antirez <antirez@gmail.com> | 2014-12-11 15:57:11 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-12-11 15:57:23 +0100 |
commit | 3cd36a4dd9b31b351c87f1084bc6166a44044315 (patch) | |
tree | c82bc3b15fe488bf93911b73702a64754b9e1845 /src | |
parent | c50693d40fa4f950a21f48513edefd40714ff5e4 (diff) | |
download | redis-3cd36a4dd9b31b351c87f1084bc6166a44044315.tar.gz |
SORT: Don't sort Set elements if not needed.
Related to #2094.
Diffstat (limited to 'src')
-rw-r--r-- | src/sort.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sort.c b/src/sort.c index d3521e663..2b3276448 100644 --- a/src/sort.c +++ b/src/sort.c @@ -291,7 +291,9 @@ void sortCommand(redisClient *c) { * The other types (list, sorted set) will retain their native order * even if no sort order is requested, so they remain stable across * scripting and replication. */ - if ((dontsort && sortval->type == REDIS_SET)) + if (dontsort && + sortval->type == REDIS_SET && + (storekey || c->flags & REDIS_LUA_CLIENT)) { /* Force ALPHA sorting */ dontsort = 0; |