mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-15 17:38:45 +00:00
DomainMatcher: Reduce runtime memory usage and startup peak memory on iOS (#5924)
https://github.com/XTLS/Xray-core/pull/5814#issuecomment-4231071433 Closes https://github.com/XTLS/Xray-core/issues/4422
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
package geodata
|
||||
|
||||
type DomainRegistry struct{}
|
||||
type DomainRegistry struct {
|
||||
factory DomainMatcherFactory
|
||||
}
|
||||
|
||||
func (r *DomainRegistry) BuildDomainMatcher(rules []*DomainRule) (DomainMatcher, error) {
|
||||
return buildDomainMatcher(rules)
|
||||
return r.factory.BuildMatcher(rules)
|
||||
}
|
||||
|
||||
func newDomainRegistry() *DomainRegistry {
|
||||
return &DomainRegistry{}
|
||||
return &DomainRegistry{
|
||||
factory: newDomainMatcherFactory(),
|
||||
}
|
||||
}
|
||||
|
||||
var DomainReg = newDomainRegistry()
|
||||
|
||||
Reference in New Issue
Block a user