mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +00:00
[DS-707] Inefficient use of keySet iterators
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5474 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -1255,23 +1255,10 @@ public class Group extends DSpaceObject
|
||||
// so now to establish all parent,child relationships we can iterate
|
||||
// through the parents hash
|
||||
|
||||
Iterator<Integer> i = parents.keySet().iterator();
|
||||
|
||||
while (i.hasNext())
|
||||
for (Map.Entry<Integer, Set<Integer>> parent : parents.entrySet())
|
||||
{
|
||||
Integer parentID = i.next();
|
||||
|
||||
Set<Integer> myChildren = getChildren(parents, parentID);
|
||||
|
||||
Iterator<Integer> j = myChildren.iterator();
|
||||
|
||||
while (j.hasNext())
|
||||
{
|
||||
// child of a parent
|
||||
Integer childID = j.next();
|
||||
|
||||
((Set<Integer>) parents.get(parentID)).add(childID);
|
||||
}
|
||||
Set<Integer> myChildren = getChildren(parents, parent.getKey());
|
||||
parent.getValue().addAll(myChildren);
|
||||
}
|
||||
|
||||
// empty out group2groupcache table
|
||||
|
Reference in New Issue
Block a user