adjust memory layout to avoid possible nil pointer
This commit is contained in:
@@ -37,10 +37,10 @@ type NeedleMapper interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type baseNeedleMapper struct {
|
type baseNeedleMapper struct {
|
||||||
|
mapMetric
|
||||||
|
|
||||||
indexFile *os.File
|
indexFile *os.File
|
||||||
indexFileAccessLock sync.Mutex
|
indexFileAccessLock sync.Mutex
|
||||||
|
|
||||||
mapMetric
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (nm *baseNeedleMapper) IndexFileSize() uint64 {
|
func (nm *baseNeedleMapper) IndexFileSize() uint64 {
|
||||||
|
|||||||
@@ -10,9 +10,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type NeedleMap struct {
|
type NeedleMap struct {
|
||||||
m needle_map.NeedleValueMap
|
|
||||||
|
|
||||||
baseNeedleMapper
|
baseNeedleMapper
|
||||||
|
m needle_map.NeedleValueMap
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCompactNeedleMap(file *os.File) *NeedleMap {
|
func NewCompactNeedleMap(file *os.File) *NeedleMap {
|
||||||
|
|||||||
Reference in New Issue
Block a user