repo-updater: optimize computeNotClonedCount
Created by: keegancsmith
This is a cherry-pick of an unrelated commit in https://github.com/sourcegraph/sourcegraph/pull/11602
I haven't actually validated this is faster. I would suspect that delete does extra work compared to updating a value in a hashtable. So not sure if it is faster in the common case where nearly everything in the list is cloned (and therefore deleted). However, in the interest of discussion I have opened this PR with @slimsag's commit :)
I made one small change from the original commit. I just always call delete and avoid the extra lookup. Delete is a noop if the key is no present.