mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
core: refactor to use a generic-compatible syncmap
This commit is contained in:
@@ -155,8 +155,7 @@ func (m *Manager) ApplyConfiguration(heads []HeadConfig, test bool) error {
|
||||
})
|
||||
|
||||
headsByName := make(map[string]*headState)
|
||||
m.heads.Range(func(key, value interface{}) bool {
|
||||
head := value.(*headState)
|
||||
m.heads.Range(func(key uint32, head *headState) bool {
|
||||
if !head.finished {
|
||||
headsByName[head.name] = head
|
||||
}
|
||||
@@ -188,14 +187,13 @@ func (m *Manager) ApplyConfiguration(heads []HeadConfig, test bool) error {
|
||||
}
|
||||
|
||||
if headCfg.ModeID != nil {
|
||||
val, exists := m.modes.Load(*headCfg.ModeID)
|
||||
mode, exists := m.modes.Load(*headCfg.ModeID)
|
||||
|
||||
if !exists {
|
||||
config.Destroy()
|
||||
resultChan <- fmt.Errorf("mode not found: %d", *headCfg.ModeID)
|
||||
return
|
||||
}
|
||||
mode := val.(*modeState)
|
||||
|
||||
if err := headConfig.SetMode(mode.handle); err != nil {
|
||||
config.Destroy()
|
||||
|
||||
Reference in New Issue
Block a user