private IEnumerable<int> SumMap(JsonMap obj) { if(MapHasRed(obj)) { yield return 0; yield break; } foreach(var property in obj.Properties) { foreach (var inner in CreateIntegerStreamWithoutRedMaps(property.Value)) { yield return inner; } } }
private bool MapHasRed(JsonMap map) { foreach(var property in map.Properties) { if(jsonStringRed.Equals(property.Value)) { return true; } } return false; }