The nix.Section method findRelated returns the first occurrence matching a filter criterion starting from any Section and returns it. To do this, it first searches downstream of the calling section, then upstream and then sideways.
The current implementation of findUpstream and findSideways are very similar. It looks likefindUpstream already implements the "sideways" search. Maybe the findUpstream function could be refactored to speed up the upwards search or the "sideways" search was supposed to search sideways further down than it does currently.
The
nix.Section
methodfindRelated
returns the first occurrence matching a filter criterion starting from anySection
and returns it. To do this, it first searches downstream of the calling section, then upstream and then sideways.The current implementation of
findUpstream
andfindSideways
are very similar. It looks likefindUpstream
already implements the "sideways" search. Maybe thefindUpstream
function could be refactored to speed up the upwards search or the "sideways" search was supposed to search sideways further down than it does currently.