File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ type snapshotFS struct {
30
30
readFiles collections.SyncMap [tspath.Path , memoizedDiskFile ]
31
31
}
32
32
33
- type memoizedDiskFile func () * diskFile
33
+ type memoizedDiskFile func () FileHandle
34
34
35
35
func (s * snapshotFS ) FS () vfs.FS {
36
36
return s .fs
@@ -43,18 +43,14 @@ func (s *snapshotFS) GetFile(fileName string) FileHandle {
43
43
if file , ok := s .diskFiles [s .toPath (fileName )]; ok {
44
44
return file
45
45
}
46
- newEntry := memoizedDiskFile (sync .OnceValue (func () * diskFile {
46
+ newEntry := memoizedDiskFile (sync .OnceValue (func () FileHandle {
47
47
if contents , ok := s .fs .ReadFile (fileName ); ok {
48
48
return newDiskFile (fileName , contents )
49
49
}
50
50
return nil
51
51
}))
52
52
entry , _ := s .readFiles .LoadOrStore (s .toPath (fileName ), newEntry )
53
- file := entry ()
54
- if file == nil {
55
- return nil
56
- }
57
- return file
53
+ return entry ()
58
54
}
59
55
60
56
type snapshotFSBuilder struct {
You can’t perform that action at this time.
0 commit comments