Minor optimization in needsUpdate().
This commit is contained in:
parent
f04fbc1c3e
commit
a60b7ff548
1 changed files with 4 additions and 1 deletions
|
@ -61,7 +61,10 @@ public final class SkinFile implements Updatable {
|
|||
* the file has been modified or deleted.
|
||||
*/
|
||||
public boolean needsUpdate () {
|
||||
return (skin != null && lastmod != file.lastModified ()) || !file.exists ();
|
||||
// if skin object is null we only need to call update if the file doesn't
|
||||
// exist anymore, while if the skin is initialized, we'll catch both
|
||||
// cases (file deleted and file changed) by just calling lastModified().
|
||||
return skin != null ? lastmod != file.lastModified () : !file.exists ();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue