File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ Andrew Reid <andrew.reid at tixtrack.com>
2020Animesh Ray <mail.rayanimesh at gmail.com>
2121Arne Hormann <arnehormann at gmail.com>
2222Ariel Mashraki <ariel at mashraki.co.il>
23+ Artur Melanchyk <artur.melanchyk@gmail.com>
2324Asta Xie <xiemengjun at gmail.com>
2425B Lamarche <blam413 at gmail.com>
2526Brian Hendriks <brian at dolthub.com>
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import (
1717)
1818
1919var (
20- fileRegister map [string ]bool
20+ fileRegister map [string ]struct {}
2121 fileRegisterLock sync.RWMutex
2222 readerRegister map [string ]func () io.Reader
2323 readerRegisterLock sync.RWMutex
@@ -37,10 +37,10 @@ func RegisterLocalFile(filePath string) {
3737 fileRegisterLock .Lock ()
3838 // lazy map init
3939 if fileRegister == nil {
40- fileRegister = make (map [string ]bool )
40+ fileRegister = make (map [string ]struct {} )
4141 }
4242
43- fileRegister [strings .Trim (filePath , `"` )] = true
43+ fileRegister [strings .Trim (filePath , `"` )] = struct {}{}
4444 fileRegisterLock .Unlock ()
4545}
4646
@@ -123,9 +123,9 @@ func (mc *okHandler) handleInFileRequest(name string) (err error) {
123123 } else { // File
124124 name = strings .Trim (name , `"` )
125125 fileRegisterLock .RLock ()
126- fr := fileRegister [name ]
126+ _ , exists := fileRegister [name ]
127127 fileRegisterLock .RUnlock ()
128- if mc .cfg .AllowAllFiles || fr {
128+ if mc .cfg .AllowAllFiles || exists {
129129 var file * os.File
130130 var fi os.FileInfo
131131
You can’t perform that action at this time.
0 commit comments