DfsObjDatabase: Add lazy last modified method to PackList
Change-Id: Id045f162fa584ea14da29a9df58a42c53a78dc15
This commit is contained in:
parent
e790ec3fb1
commit
ecb2aa0503
|
@ -495,10 +495,24 @@ public static abstract class PackList {
|
|||
/** All known packs, sorted. */
|
||||
public final DfsPackFile[] packs;
|
||||
|
||||
private long lastModified = -1;
|
||||
|
||||
PackList(DfsPackFile[] packs) {
|
||||
this.packs = packs;
|
||||
}
|
||||
|
||||
/** @return last modified time of all packs, in milliseconds. */
|
||||
public long getLastModified() {
|
||||
if (lastModified < 0) {
|
||||
long max = 0;
|
||||
for (DfsPackFile pack : packs) {
|
||||
max = Math.max(max, pack.getPackDescription().getLastModified());
|
||||
}
|
||||
lastModified = max;
|
||||
}
|
||||
return lastModified;
|
||||
}
|
||||
|
||||
abstract boolean dirty();
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue