Geodata: Cleanup unneeded matchers & domain: ignore case (#6342)

Completes https://github.com/XTLS/Xray-core/pull/6139
This commit is contained in:
Meow
2026-06-19 20:02:27 +08:00
committed by GitHub
parent 8734774e4a
commit be8009c625
5 changed files with 51 additions and 21 deletions
+14
View File
@@ -1,6 +1,7 @@
package utils
import (
"maps"
"runtime"
"sync"
"weak"
@@ -43,3 +44,16 @@ func (c *WeakCacheMap[K, V]) Store(key K, value *V) {
}
}, struct{}{})
}
func (c *WeakCacheMap[K, V]) Range(f func(K, *V) bool) {
c.mu.Lock()
snapshot := maps.Clone(c.m)
c.mu.Unlock()
for k, v := range snapshot {
if value := v.Value(); value != nil {
if !f(k, value) {
break
}
}
}
}