private static void SortNodes(FCallGraphNode ParentNode, bool bShouldSortBySize) { if (bShouldSortBySize) { ParentNode.SortChildrenByAllocationSize(); } else { ParentNode.SortChildrenByAllocationCount(); } foreach (FCallGraphNode Node in ParentNode.Children) { SortNodes(Node, bShouldSortBySize); } }