Commit 3cd36a4d authored by antirez's avatar antirez
Browse files

SORT: Don't sort Set elements if not needed.

Related to #2094.
parent c50693d4
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment