|
@ -178,11 +178,7 @@ func (nm *NeedleMap) Put(key uint64, offset uint32, size uint32) (int, error) { |
|
|
return nm.indexFile.Write(nm.bytes) |
|
|
return nm.indexFile.Write(nm.bytes) |
|
|
} |
|
|
} |
|
|
func (nm *NeedleMap) Get(key uint64) (element *NeedleValue, ok bool) { |
|
|
func (nm *NeedleMap) Get(key uint64) (element *NeedleValue, ok bool) { |
|
|
if nm.m != nil { |
|
|
|
|
|
element, ok = nm.m.Get(Key(key)) |
|
|
|
|
|
} else { |
|
|
|
|
|
element, ok = nm.fm.Get(Key(key)) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
element, ok = nm.m.Get(Key(key)) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
func (nm *NeedleMap) Delete(key uint64) error { |
|
|
func (nm *NeedleMap) Delete(key uint64) error { |
|
@ -206,8 +202,5 @@ func (nm *NeedleMap) ContentSize() uint64 { |
|
|
|
|
|
|
|
|
// iterate through all needles using the iterator function
|
|
|
// iterate through all needles using the iterator function
|
|
|
func (nm *NeedleMap) Walk(pedestrian func(*NeedleValue) error) (err error) { |
|
|
func (nm *NeedleMap) Walk(pedestrian func(*NeedleValue) error) (err error) { |
|
|
if nm.m != nil { |
|
|
|
|
|
return nm.m.Walk(pedestrian) |
|
|
|
|
|
} |
|
|
|
|
|
return nm.fm.Walk(pedestrian) |
|
|
|
|
|
|
|
|
return nm.m.Walk(pedestrian) |
|
|
} |
|
|
} |