private static IEnumerable<int[]> GetIndices(int[] indices, Array array, int dimension) { foreach (var index in array.Indices(dimension)) { indices[dimension] = index; if (dimension == array.Rank - 1) { yield return indices.ToArray(); } else { foreach (var nested in GetIndices(indices, array, dimension + 1)) { yield return nested; } } } }
private void AddDiffs( DiffBuilder collectionBuilder, Array x, Array y, MemberSettings settings) { RankDiff rankDiff; if (TryGetRankDiff(x, y, out rankDiff)) { collectionBuilder.Add(rankDiff); return; } foreach (var index in x.Indices()) { collectionBuilder.UpdateCollectionItemDiff(x.GetValue(index), y.GetValue(index), new Index(index), settings); } }