PackWriter: Refactor object writing loop
This simple refactoring makes it easier to pre-process each of the object lists before its handed into the actual write routine. Change-Id: Iea95e5ecbc7374f6bcbb43d1c75285f4f564d09d Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
751c329b35
commit
26dffbe04d
|
@ -977,14 +977,17 @@ private void runTasks(ExecutorService pool, ThreadSafeProgressMonitor pm,
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeObjects(PackOutputStream out) throws IOException {
|
private void writeObjects(PackOutputStream out) throws IOException {
|
||||||
|
for (List<ObjectToPack> list : objectsLists)
|
||||||
|
writeObjects(out, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void writeObjects(PackOutputStream out, List<ObjectToPack> list)
|
||||||
|
throws IOException {
|
||||||
if (reuseSupport != null) {
|
if (reuseSupport != null) {
|
||||||
for (List<ObjectToPack> list : objectsLists)
|
reuseSupport.writeObjects(out, list);
|
||||||
reuseSupport.writeObjects(out, list);
|
|
||||||
} else {
|
} else {
|
||||||
for (List<ObjectToPack> list : objectsLists) {
|
for (ObjectToPack otp : list)
|
||||||
for (ObjectToPack otp : list)
|
out.writeObject(otp);
|
||||||
out.writeObject(otp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue