Merge branch 'master' into 1.16

This commit is contained in:
gnembon committed 2020-07-08 00:48:56 -03:00
commit bba9f4e88d
5 files changed
+55 -6

No files matched your search

@@ -97,8 +97,24 @@ public class MapValue extends AbstractListValue implements ContainerValueInterfa
@Override
public Value add(Value o)
{
append(o);
return this;
Map<Value, Value> newItems = new HashMap<>(map);
if (o instanceof MapValue)
{
newItems.putAll(((MapValue) o).map);
}
else if (o instanceof AbstractListValue)
{
Iterator<Value> it = ((AbstractListValue) o).iterator();
while (it.hasNext())
{
newItems.put(it.next(), Value.NULL);
}
}
else
{
newItems.put(o, Value.NULL);
}
return MapValue.wrap(newItems);
}
@Override