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,16 +977,19 @@ private void runTasks(ExecutorService pool, ThreadSafeProgressMonitor pm,
|
|||
}
|
||||
|
||||
private void writeObjects(PackOutputStream out) throws IOException {
|
||||
if (reuseSupport != null) {
|
||||
for (List<ObjectToPack> list : objectsLists)
|
||||
writeObjects(out, list);
|
||||
}
|
||||
|
||||
private void writeObjects(PackOutputStream out, List<ObjectToPack> list)
|
||||
throws IOException {
|
||||
if (reuseSupport != null) {
|
||||
reuseSupport.writeObjects(out, list);
|
||||
} else {
|
||||
for (List<ObjectToPack> list : objectsLists) {
|
||||
for (ObjectToPack otp : list)
|
||||
out.writeObject(otp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void writeObject(PackOutputStream out, ObjectToPack otp) throws IOException {
|
||||
if (otp.isWritten())
|
||||
|
|
Loading…
Reference in New Issue