Fix unit prefetcher version bug
Summary:
When inserting information about a unit into the version map, we
weren't providing the current version number. Instead it was just
being default constructed, so everything got zero. As a result, later
checks would always fail and we'd enqueue the unit for
prefetching. Properly insert the current version number.
Note: This isn't a correctness issue. It's just an efficiency concern
since we don't prune pointless prefetch requests early.
While I'm at it, only increment the version if the unit is reported as
changed *and* the an unit is actually stored in the unit map. If not,
it means the unit is being created, so there's no point in treating it
as changed again. This cuts down on a lot of spurious version
increments.
Reviewed By: mofarrell
Differential Revision:
D23554971
fbshipit-source-id:
ee0947e9955d37adad05bf276c2b1cec8c8f15d5