fix: deadlock (#723)

This commit is contained in:
naison
2025-09-30 16:29:20 +08:00
committed by GitHub
parent 00bcef1e49
commit f6d23566d2

View File

@@ -147,9 +147,6 @@ func (c *Config) removeHosts(hosts []Entry) error {
return nil
}
c.Lock.Lock()
defer c.Lock.Unlock()
for i := 0; i < len(c.Hosts); i++ {
if sets.New[Entry]().Insert(hosts...).Has(c.Hosts[i]) {
c.Hosts = append(c.Hosts[:i], c.Hosts[i+1:]...)