summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/openslx/imagemaster/crcchecker/CRCFile.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/org/openslx/imagemaster/crcchecker/CRCFile.java b/src/main/java/org/openslx/imagemaster/crcchecker/CRCFile.java
index 807aac1..1fa7453 100644
--- a/src/main/java/org/openslx/imagemaster/crcchecker/CRCFile.java
+++ b/src/main/java/org/openslx/imagemaster/crcchecker/CRCFile.java
@@ -18,6 +18,7 @@ public class CRCFile
{
private File file = null;
private List<Integer> crcSums = null;
+ private Boolean valid = null;
/**
* Loads a crcFile from file
@@ -93,13 +94,16 @@ public class CRCFile
*/
public boolean isValid() throws IOException
{
- if ( file == null ) {
- return sumsAreValid( this.crcSums );
- } else {
- if ( crcSums == null )
- loadSums();
- return sumsAreValid( this.crcSums );
+ if ( valid == null ) {
+ if ( file == null ) {
+ valid = sumsAreValid( this.crcSums );
+ } else {
+ if ( crcSums == null )
+ loadSums();
+ valid = sumsAreValid( this.crcSums );
+ }
}
+ return valid;
}
/**