From 60623dcfe9a96274079388b205eebd6ffaf16cfd Mon Sep 17 00:00:00 2001 From: arkxfly Date: Sat, 27 Sep 2025 18:19:05 +0800 Subject: [PATCH] Optimize outbounds sorting: prioritize regex matches, followed by others --- template/render_outbounds.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/render_outbounds.go b/template/render_outbounds.go index 9486f02..ff93cd7 100644 --- a/template/render_outbounds.go +++ b/template/render_outbounds.go @@ -208,7 +208,7 @@ func (t *Template) renderOutbounds(metadata M.Metadata, options *boxOption.Optio } sort.Strings(extraTags) if len(extraTags) == 0 || extraGroup.filter != nil || extraGroup.exclude != nil { - extraTags = append(extraTags, common.Filter(common.FlatMap(subscriptions, func(it *subscription.Subscription) []string { + extraTags = append(common.Filter(common.FlatMap(subscriptions, func(it *subscription.Subscription) []string { return common.Map(it.Servers, outboundToString) }), func(outboundTag string) bool { if len(extraGroup.filter) > 0 { @@ -226,7 +226,7 @@ func (t *Template) renderOutbounds(metadata M.Metadata, options *boxOption.Optio } } return true - })...) + }), extraTags...) } groupOutbound := boxOption.Outbound{ Tag: extraGroup.Tag,