speed up dependency calculation by a whole lot.
Revert "speed up dependency calculation by a whole lot."

Turns out it shouldn't have been ^ but ^^. The merits of the optimization are
therefore slightly suspect.

This reverts commit 18a5e5a1fa77a58abcf39e0aa008a11cd28e5b94.