Don't call recursion where it's redundant. The recursive algorithm can carry dangerous behavior due to stack growth and overflow. The probability is low for something like the frame nodes. But using a loop is cheap, providing O(N = const) memory cost. A loop through the links in a singly linked list is sufficient. The use of 2D vectors for location mapping and other things can be separate. Pull Request #105394