Fix compilation failure in Android test project

This commit is contained in:
Bartłomiej Dach 2020-06-04 23:50:58 +02:00
parent c4cae006aa
commit 4c6116e6e7
1 changed files with 7 additions and 5 deletions

View File

@ -58,17 +58,19 @@ public bool Equals(SampleConvertValue other)
&& Precision.AlmostEquals(EndTime, other.EndTime, conversion_lenience) && Precision.AlmostEquals(EndTime, other.EndTime, conversion_lenience)
&& samplesEqual(NodeSamples, other.NodeSamples); && samplesEqual(NodeSamples, other.NodeSamples);
private static bool samplesEqual(ICollection<IList<string>> first, ICollection<IList<string>> second) private static bool samplesEqual(ICollection<IList<string>> firstSampleList, ICollection<IList<string>> secondSampleList)
{ {
if (first == null && second == null) if (firstSampleList == null && secondSampleList == null)
return true; return true;
// both items can't be null now, so if any single one is, then they're not equal // both items can't be null now, so if any single one is, then they're not equal
if (first == null || second == null) if (firstSampleList == null || secondSampleList == null)
return false; return false;
return first.Count == second.Count return firstSampleList.Count == secondSampleList.Count
&& first.Zip(second).All(samples => samples.First.SequenceEqual(samples.Second)); // cannot use .Zip() without the selector function as it doesn't compile in android test project
&& firstSampleList.Zip(secondSampleList, (first, second) => (first, second))
.All(samples => samples.first.SequenceEqual(samples.second));
} }
} }
} }