From 97bbfdc2d6a9bc3e9ce7b4dd17bbb6733e53e4cf Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 24 Jun 2011 16:40:36 -0700 Subject: [PATCH] Iterate over entry set instead of key set. --- src/main/java/redis/clients/jedis/BinaryClient.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/redis/clients/jedis/BinaryClient.java b/src/main/java/redis/clients/jedis/BinaryClient.java index 050964a8ac..4a76a63bc9 100644 --- a/src/main/java/redis/clients/jedis/BinaryClient.java +++ b/src/main/java/redis/clients/jedis/BinaryClient.java @@ -11,6 +11,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import redis.clients.jedis.Protocol.Command; import redis.clients.jedis.Protocol.Keyword; @@ -205,9 +206,9 @@ public void hmset(final byte[] key, final Map hash) { final List params = new ArrayList(); params.add(key); - for (final byte[] field : hash.keySet()) { - params.add(field); - params.add(hash.get(field)); + for (final Entry entry : hash.entrySet()) { + params.add(entry.getKey()); + params.add(entry.getValue()); } sendCommand(HMSET, params.toArray(new byte[params.size()][])); }