From 4c31b6d5334c7dc5533d0c790e5dbd17ee391d6e Mon Sep 17 00:00:00 2001 From: "chris.lu@gmail.com" Date: Thu, 19 Jan 2012 18:28:54 +0000 Subject: [PATCH] delete entry from file index also git-svn-id: https://weed-fs.googlecode.com/svn/trunk@44 282b0af5-e82d-9cf1-ede4-77906d7719d0 --- weed-fs/src/pkg/storage/needle_map.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/weed-fs/src/pkg/storage/needle_map.go b/weed-fs/src/pkg/storage/needle_map.go index 19030be3f..3cdcf6328 100644 --- a/weed-fs/src/pkg/storage/needle_map.go +++ b/weed-fs/src/pkg/storage/needle_map.go @@ -43,9 +43,7 @@ func LoadNeedleMap(file *os.File) *NeedleMap { key := BytesToUint64(bytes[i : i+8]) offset := BytesToUint32(bytes[i+8 : i+12]) size := BytesToUint32(bytes[i+12 : i+16]) - if offset > 0 { - nm.m[key] = &NeedleValue{Offset: offset, Size: size} - } + nm.m[key] = &NeedleValue{Offset: offset, Size: size}, offset > 0 } count, e = nm.indexFile.Read(bytes) }