From a60b7ff548f8f2888ee599d12ad9278422e9bc83 Mon Sep 17 00:00:00 2001 From: hns Date: Thu, 31 Oct 2002 15:27:50 +0000 Subject: [PATCH] Minor optimization in needsUpdate(). --- src/helma/framework/core/SkinFile.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/helma/framework/core/SkinFile.java b/src/helma/framework/core/SkinFile.java index 711b90c5..bd793fc8 100644 --- a/src/helma/framework/core/SkinFile.java +++ b/src/helma/framework/core/SkinFile.java @@ -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 (); }