core: avoid lock copy in private DAO constructor
Fix the following linter warning: ``` pkg/core/dao/dao.go:101:7 govet copylocks: assignment copies lock value to *d: github.com/nspcc-dev/neo-go/pkg/core/dao.Simple contains sync.RWMutex ```
This commit is contained in:
parent
8d2d48f360
commit
a6a0c1eb12
1 changed files with 5 additions and 2 deletions
|
@ -92,8 +92,11 @@ func (dao *Simple) GetWrapped() *Simple {
|
|||
// GetPrivate returns new DAO instance with another layer of private
|
||||
// MemCachedStore around the current DAO Store.
|
||||
func (dao *Simple) GetPrivate() *Simple {
|
||||
d := &Simple{}
|
||||
*d = *dao // Inherit everything...
|
||||
d := &Simple{
|
||||
Version: dao.Version,
|
||||
keyBuf: dao.keyBuf,
|
||||
dataBuf: dao.dataBuf,
|
||||
} // Inherit everything...
|
||||
d.Store = storage.NewPrivateMemCachedStore(dao.Store) // except storage, wrap another layer.
|
||||
d.private = true
|
||||
d.nativeCachePS = dao
|
||||
|
|
Loading…
Reference in a new issue