Skip to content

Commit d544ae8

Browse files
committed
CollectionValue EqualCondition fix
1 parent cfd50e3 commit d544ae8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ValueSystem/CollectionValue.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@ public Type Type
5050
}
5151
} = null!;
5252

53-
public override bool EqualCondition(Value other) => other is CollectionValue otherP && CastedValues.SequenceEqual(otherP.CastedValues) && Type == otherP.Type;
53+
public override bool EqualCondition(Value other)
54+
{
55+
if (other is not CollectionValue otherP || otherP.CastedValues.Length != CastedValues.Length) return false;
56+
for (int i = 0; i < CastedValues.Length; i++)
57+
{
58+
if (!CastedValues[i].EqualCondition(otherP.CastedValues[i])) return false;
59+
}
60+
return true;
61+
}
5462

5563
public TryGet<Value> GetAt(int index)
5664
{

0 commit comments

Comments
 (0)