Skip to content

Commit

Permalink
Iterate over entry set instead of key set.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsawicki committed Jun 24, 2011
1 parent 6c3ec9f commit 97bbfdc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/redis/clients/jedis/BinaryClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -205,9 +206,9 @@ public void hmset(final byte[] key, final Map<byte[], byte[]> hash) {
final List<byte[]> params = new ArrayList<byte[]>();
params.add(key);

for (final byte[] field : hash.keySet()) {
params.add(field);
params.add(hash.get(field));
for (final Entry<byte[], byte[]> entry : hash.entrySet()) {
params.add(entry.getKey());
params.add(entry.getValue());
}
sendCommand(HMSET, params.toArray(new byte[params.size()][]));
}
Expand Down

0 comments on commit 97bbfdc

Please sign in to comment.