Skip to content

Commit 334cbd3

Browse files
authoredOct 24, 2024··
fix(routing): Fix MergeAndSortRulesOptimizer (#682)
1 parent 438c05c commit 334cbd3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎component/routing/optimizer.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ package routing
77

88
import (
99
"fmt"
10+
"net/netip"
11+
"sort"
12+
"strings"
13+
1014
"github.com/daeuniverse/dae/common/assets"
1115
"github.com/daeuniverse/dae/common/consts"
1216
"github.com/daeuniverse/dae/pkg/config_parser"
1317
"github.com/daeuniverse/dae/pkg/geodata"
1418
"github.com/mohae/deepcopy"
1519
"github.com/sirupsen/logrus"
16-
"net/netip"
17-
"sort"
18-
"strings"
1920
)
2021

2122
type RulesOptimizer interface {
@@ -87,6 +88,7 @@ func (o *MergeAndSortRulesOptimizer) Optimize(rules []*config_parser.RoutingRule
8788
if len(mergingRule.AndFunctions) == 1 &&
8889
len(rules[i].AndFunctions) == 1 &&
8990
mergingRule.AndFunctions[0].Name == rules[i].AndFunctions[0].Name &&
91+
mergingRule.AndFunctions[0].Not == rules[i].AndFunctions[0].Not &&
9092
rules[i].Outbound.String(true, false, true) == mergingRule.Outbound.String(true, false, true) {
9193
mergingRule.AndFunctions[0].Params = append(mergingRule.AndFunctions[0].Params, rules[i].AndFunctions[0].Params...)
9294
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.