chore: fix deleting from slice
This commit is contained in:
parent
01504b99e9
commit
4406b23999
2 changed files with 2 additions and 2 deletions
|
|
@ -78,7 +78,7 @@ func Delete(key string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
settings = slices.Delete(settings, idx, idx)
|
||||
settings = slices.Delete(settings, idx, idx+1)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ func (c *EEBus) UnregisterDevice(ski string, device Device) {
|
|||
defer c.mux.Unlock()
|
||||
|
||||
if idx := slices.Index(c.clients[ski], device); idx != -1 {
|
||||
c.clients[ski] = slices.Delete(c.clients[ski], idx, idx)
|
||||
c.clients[ski] = slices.Delete(c.clients[ski], idx, idx+1)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue