The previous implementation uses ArrayList for storing resolved resources and ArrayList has O(n) time complexity for the contains operation. By switching to the HashSet for storing resolved resources we improve the time complexity of this operation to be O(1). See gh-25927