@@ -247,43 +247,6 @@ public AbstractMapType merge(final Iterable<AbstractMapType> others, final Binar
247
247
return new MapType (context , newMap .forked (), prevType );
248
248
}
249
249
250
- @ Override
251
- public AbstractMapType merge (final Iterable <AbstractMapType > others , final BinaryOperator <Sequence > mergeFn ) {
252
-
253
- // create a transient map
254
- IMap <AtomicValue , Sequence > newMap = map .linear ();
255
-
256
- int prevType = keyType ;
257
- for (final AbstractMapType other : others ) {
258
- if (other instanceof MapType ) {
259
- // MapType - optimise merge
260
- final MapType otherMap = (MapType ) other ;
261
- newMap = newMap .merge (otherMap .map , mergeFn );
262
-
263
- if (prevType != otherMap .keyType ) {
264
- prevType = MIXED_KEY_TYPES ;
265
- }
266
- } else {
267
- // non MapType
268
- for (final IEntry <AtomicValue , Sequence > entry : other ) {
269
- final AtomicValue key = entry .key ();
270
- final Optional <Sequence > headEntry = newMap .get (key );
271
- if (headEntry .isPresent ()) {
272
- newMap = newMap .put (key , mergeFn .apply (headEntry .get (), entry .value ()));
273
- } else {
274
- newMap = newMap .put (key , entry .value ());
275
- }
276
- if (prevType != key .getType ()) {
277
- prevType = MIXED_KEY_TYPES ;
278
- }
279
- }
280
- }
281
- }
282
-
283
- // return an immutable map
284
- return new MapType (context , newMap .forked (), prevType );
285
- }
286
-
287
250
public void add (final AtomicValue key , final Sequence value ) {
288
251
setKeyType (key .getType ());
289
252
map = map .put (key , value );
0 commit comments