Hi,

In the method mentioned below[1] rather than checking contains key the whole code can be replaced with the code mentioned below[2] because this will reduce the no of times contains is performed on the set.
[1]
private boolean checkAlreadyAdded(PositionedInfo info)
   {
       Long key = new Long(info.hashCode());
       if (alreadySeenResources.contains(key))
       {
           return true;
       }
       alreadySeenResources.add(key);
       return false;
   }

[2]
private boolean checkAlreadyAdded(PositionedInfo info)
   {
        return !alreadySeenResources.add(new Long(info.hashCode()));
   }

if it is appropriate pls comment and i'l open a issue in jira .

Regards,
David Brainard

Reply via email to