diff options
author | Roey Prat <roey.prat@redislabs.com> | 2018-10-28 09:51:55 +0200 |
---|---|---|
committer | Roey Prat <roey.prat@redislabs.com> | 2018-10-28 14:13:42 +0200 |
commit | 44942c7c5254bfaf2304299e82a49ef548bd31cb (patch) | |
tree | c75f98db23e2f19a10ffea9522ffab63b54c29ef | |
parent | abbd97050a7cb3e687c3ab23d6fc550e5f197b8d (diff) | |
download | redis-py-44942c7c5254bfaf2304299e82a49ef548bd31cb.tar.gz |
pieces.extend(pair) is slightly more efficient.
-rwxr-xr-x | redis/client.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py index 842f5e9..78b8302 100755 --- a/redis/client.py +++ b/redis/client.py @@ -1773,8 +1773,7 @@ class StrictRedis(object): if not isinstance(fields, dict) or len(fields) == 0: raise RedisError('XADD fields must be a non-empty dict') for pair in iteritems(fields): - pieces.append(pair[0]) - pieces.append(pair[1]) + pieces.extend(pair) return self.execute_command('XADD', _name, *pieces) def xrange(self, name, start='-', finish='+', count=None): |