Skip to content

Commit

Permalink
Merge branch 'main' into hy2
Browse files Browse the repository at this point in the history
  • Loading branch information
mzz2017 authored Oct 26, 2024
2 parents b572caf + 334cbd3 commit bb0f6f3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions component/routing/optimizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ package routing

import (
"fmt"
"net/netip"
"sort"
"strings"

"github.com/daeuniverse/dae/common/assets"
"github.com/daeuniverse/dae/common/consts"
"github.com/daeuniverse/dae/pkg/config_parser"
"github.com/daeuniverse/dae/pkg/geodata"
"github.com/mohae/deepcopy"
"github.com/sirupsen/logrus"
"net/netip"
"sort"
"strings"
)

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

0 comments on commit bb0f6f3

Please sign in to comment.