|
|
@ -292,7 +292,20 @@ public class ObjectDirectory extends ObjectDatabase { |
|
|
|
PackList o, n; |
|
|
|
PackList o, n; |
|
|
|
do { |
|
|
|
do { |
|
|
|
o = packList.get(); |
|
|
|
o = packList.get(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If the pack in question is already present in the list
|
|
|
|
|
|
|
|
// (picked up by a concurrent thread that did a scan?) we
|
|
|
|
|
|
|
|
// do not want to insert it a second time.
|
|
|
|
|
|
|
|
//
|
|
|
|
final PackFile[] oldList = o.packs; |
|
|
|
final PackFile[] oldList = o.packs; |
|
|
|
|
|
|
|
final String name = pf.getPackFile().getName(); |
|
|
|
|
|
|
|
for (PackFile p : oldList) { |
|
|
|
|
|
|
|
if (PackFile.SORT.compare(pf, p) < 0) |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
if (name.equals(p.getPackFile().getName())) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
final PackFile[] newList = new PackFile[1 + oldList.length]; |
|
|
|
final PackFile[] newList = new PackFile[1 + oldList.length]; |
|
|
|
newList[0] = pf; |
|
|
|
newList[0] = pf; |
|
|
|
System.arraycopy(oldList, 0, newList, 1, oldList.length); |
|
|
|
System.arraycopy(oldList, 0, newList, 1, oldList.length); |
|
|
|