perf: no need to insert a dep in seen list if its already there.

no need to insert a dep in seen list if its already there.
no need to double allocate the array.