]> Cypherpunks.ru repositories - goredo.git/blobdiff - ood.go
Optimise reading of only Build metainformation
[goredo.git] / ood.go
diff --git a/ood.go b/ood.go
index 1be39573bd4b15e2ad1ada84fec28210e9089337..4a284c6ceaf31db355b53890957473a06ec30cf5 100644 (file)
--- a/ood.go
+++ b/ood.go
@@ -47,8 +47,8 @@ var (
        FdOODTgts     *os.File
        FdOODTgtsLock *os.File
 
-       OODCache        map[string]bool = make(map[string]bool)
-       FileExistsCache map[string]bool = make(map[string]bool)
+       OODCache        = make(map[string]bool)
+       FileExistsCache = make(map[string]bool)
 
        ErrMissingTarget = errors.New("invalid format of .rec: missing Target")
 )
@@ -96,16 +96,8 @@ func isSrc(cwd, tgt string) bool {
 func isOODByBuildUUID(cwd, tgtOrig string) bool {
        cwd, tgt := cwdAndTgt(path.Join(cwd, tgtOrig))
        depPath := path.Join(cwd, RedoDir, tgt+DepSuffix)
-       fdDep, err := os.Open(depPath)
-       if err != nil {
-               return true
-       }
-       depInfo, err := depRead(fdDep)
-       fdDep.Close()
-       if err != nil || depInfo.build != BuildUUID {
-               return true
-       }
-       return false
+       build, err := depReadBuild(depPath)
+       return err != nil || build != BuildUUID
 }
 
 func isOOD(cwd, tgtOrig string, level int, seen map[string]struct{}) (bool, error) {