private HashSet <int> GetParentsBelowRecursive(BackendData.Foo searchFromThis) { HashSet <int> parentIDs = new HashSet <int>(); BackendData.GetParentsBelowRecursive(searchFromThis, parentIDs); return(parentIDs); }
private HashSet <int> GetParentsBelowRecursive(BackendData.Foo searchFromThis) { HashSet <int> hashSet = new HashSet <int>(); BackendData.GetParentsBelowRecursive(searchFromThis, hashSet); return(hashSet); }
private static void GetParentsBelowRecursive(BackendData.Foo item, HashSet <int> parentIDs) { if (!item.hasChildren) { return; } parentIDs.Add(item.id); foreach (BackendData.Foo current in item.children) { BackendData.GetParentsBelowRecursive(current, parentIDs); } }
private static void GetParentsBelowRecursive(BackendData.Foo item, HashSet <int> parentIDs) { if (!item.hasChildren) { return; } parentIDs.Add(item.id); using (List <BackendData.Foo> .Enumerator enumerator = item.children.GetEnumerator()) { while (enumerator.MoveNext()) { BackendData.GetParentsBelowRecursive(enumerator.Current, parentIDs); } } }