optimized findDependencies. tested on pc: cpu: intel i7 3.5Ghz 16GB ram, raid 10.
compile time in my small project with only 137 dependencies:
before fix: 217 seconds
after fix: 3 seconds