Skip to content

Commit 4ea8429

Browse files
committed
Merge branch 'pr-32' into stack-1.1.3
2 parents 003d1c8 + 35e05a0 commit 4ea8429

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

src/Elm/Kernel/Json.js

+25-2
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ function _Json_equality(x, y)
382382
return x.__index === y.__index && _Json_equality(x.__decoder, y.__decoder);
383383

384384
case __1_MAP:
385-
return x.__func === y.__func && _Json_listEquality(x.__decoders, y.__decoders);
385+
return x.__func === y.__func && _Json_arrayEquality(x.__decoders, y.__decoders);
386386

387387
case __1_AND_THEN:
388388
return x.__callback === y.__callback && _Json_equality(x.__decoder, y.__decoder);
@@ -392,7 +392,7 @@ function _Json_equality(x, y)
392392
}
393393
}
394394

395-
function _Json_listEquality(aDecoders, bDecoders)
395+
function _Json_arrayEquality(aDecoders, bDecoders)
396396
{
397397
var len = aDecoders.length;
398398
if (len !== bDecoders.length)
@@ -409,6 +409,29 @@ function _Json_listEquality(aDecoders, bDecoders)
409409
return true;
410410
}
411411

412+
function _Json_listEquality(aDecoders, bDecoders)
413+
{
414+
var tempA = aDecoders;
415+
var tempB = bDecoders;
416+
while (tempA.b)
417+
{
418+
if (!tempB.b)
419+
{
420+
return false;
421+
}
422+
if (!_Json_equality(tempA.a, tempB.a))
423+
{
424+
return false;
425+
}
426+
tempA = tempA.b;
427+
tempB = tempB.b;
428+
}
429+
if (tempB.b)
430+
{
431+
return false;
432+
}
433+
return true;
434+
}
412435

413436
// ENCODE
414437

0 commit comments

Comments
 (0)