use a set in `resolve_dependencies` so we don't need two data structures

As the subject says, just use a set so we don't need to keep checking a cache hash.