Removing extra normalize call

(since open already normalizes)
This commit is contained in:
Steve Francia 2015-12-03 22:28:21 -05:00
parent 54ad8f690d
commit a9385f2db9
1 changed files with 2 additions and 1 deletions

View File

@ -37,6 +37,7 @@ func (m *MemMapFs) lock() {
mx := m.getMutex() mx := m.getMutex()
mx.Lock() mx.Lock()
} }
func (m *MemMapFs) unlock() { m.getMutex().Unlock() } func (m *MemMapFs) unlock() { m.getMutex().Unlock() }
func (m *MemMapFs) rlock() { m.getMutex().RLock() } func (m *MemMapFs) rlock() { m.getMutex().RLock() }
func (m *MemMapFs) runlock() { m.getMutex().RUnlock() } func (m *MemMapFs) runlock() { m.getMutex().RUnlock() }
@ -227,6 +228,7 @@ func (m *MemMapFs) Open(name string) (File, error) {
m.rlock() m.rlock()
f, ok := m.getData()[name] f, ok := m.getData()[name]
ff, ok := f.(*InMemoryFile) ff, ok := f.(*InMemoryFile)
if ok { if ok {
ff.Open() ff.Open()
} }
@ -346,7 +348,6 @@ func (m *MemMapFs) Rename(oldname, newname string) error {
} }
func (m *MemMapFs) Stat(name string) (os.FileInfo, error) { func (m *MemMapFs) Stat(name string) (os.FileInfo, error) {
name = normalizePath(name)
f, err := m.Open(name) f, err := m.Open(name)
if err != nil { if err != nil {
return nil, err return nil, err