Skip to content

Commit 0348a49

Browse files
authored
fix indexing bug in constructor (#525)
fix ValueFactory.newMap(Entry<Value, Value>...pairs), which is currently iterating by 2 when it should be iterating through each passed in pair.
1 parent d591f0c commit 0348a49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

msgpack-core/src/main/java/org/msgpack/value/ValueFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public static ImmutableMapValue emptyMap()
232232
public static MapValue newMap(Map.Entry<? extends Value, ? extends Value>... pairs)
233233
{
234234
Value[] kvs = new Value[pairs.length * 2];
235-
for (int i = 0; i < pairs.length; i += 2) {
235+
for (int i = 0; i < pairs.length; ++i) {
236236
kvs[i * 2] = pairs[i].getKey();
237237
kvs[i * 2 + 1] = pairs[i].getValue();
238238
}

0 commit comments

Comments
 (0)