From a9c7565b8002a98f7dc77dfd675ecf1c803fe6b5 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 1 Nov 2016 10:34:41 +0100 Subject: fusefrontend: refactor dirIVCache Simplify the code a bit. --- internal/nametransform/diriv.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/nametransform/diriv.go') diff --git a/internal/nametransform/diriv.go b/internal/nametransform/diriv.go index 30d4b87..f8734db 100644 --- a/internal/nametransform/diriv.go +++ b/internal/nametransform/diriv.go @@ -92,8 +92,8 @@ func (be *NameTransform) EncryptPathDirIV(plainPath string, rootDir string) (cip } // Check if the DirIV is cached parentDir := filepath.Dir(plainPath) - found, iv, cParentDir := be.DirIVCache.lookup(parentDir) - if found { + iv, cParentDir := be.DirIVCache.lookup(parentDir) + if iv != nil { cBaseName := be.EncryptName(baseName, iv) if be.longNames && len(cBaseName) > syscall.NAME_MAX { cBaseName = HashLongName(cBaseName) -- cgit v1.2.3