The ugly code is ugly because of the `next()` tric...
# general
b
The ugly code is ugly because of the
next()
trick and knowledge that every target wraps a private
_build_graph
. But we can glance at those things and see pretty quickly that they are correct given the state of the world in pants (that isn't changing before 2.0). On the other hand, a reimplementation of a core algorithm at every spot where it's used to avoid the ugly code is super dangerous. It is not obvious at a glance whether the code is subtly broken in terms of either perf or correctness--once again, as evidenced by the need for this patch.