mirror of
https://github.com/restic/restic.git
synced 2025-08-12 11:47:43 +00:00
Don't separately allocate sync.{Mutex,Once} if not necessary
Separate allocation of synchronization devices suggests they're shared between objects, but they're not.
This commit is contained in:
@@ -21,7 +21,7 @@ type LocalVss struct {
|
||||
FS
|
||||
snapshots map[string]VssSnapshot
|
||||
failedSnapshots map[string]struct{}
|
||||
mutex *sync.RWMutex
|
||||
mutex sync.RWMutex
|
||||
msgError ErrorHandler
|
||||
msgMessage MessageHandler
|
||||
}
|
||||
@@ -36,7 +36,6 @@ func NewLocalVss(msgError ErrorHandler, msgMessage MessageHandler) *LocalVss {
|
||||
FS: Local{},
|
||||
snapshots: make(map[string]VssSnapshot),
|
||||
failedSnapshots: make(map[string]struct{}),
|
||||
mutex: &sync.RWMutex{},
|
||||
msgError: msgError,
|
||||
msgMessage: msgMessage,
|
||||
}
|
||||
|
Reference in New Issue
Block a user