]> 127.0.0.1 Git - front/.git/commitdiff
1 v0.1.20240507191841
authorqydysky <qydysky@foxmail.com>
Tue, 7 May 2024 19:16:45 +0000 (19:16 +0000)
committerqydysky <qydysky@foxmail.com>
Tue, 7 May 2024 19:16:45 +0000 (19:16 +0000)
config.go

index 4f6ecb5b49070650c48d5d208cc3338e60c4ab13..da9cb04b3df23480a05daea04c072ead71ba60d0 100755 (executable)
--- a/config.go
+++ b/config.go
@@ -189,7 +189,7 @@ func (t *Config) SwapSign(ctx context.Context, logger Logger) {
 
        t.routeMap.Range(func(key, value any) bool {
                var exist bool
-               for k := 0; k < len(t.Routes) && exist == false; k++ {
+               for k := 0; k < len(t.Routes) && !exist; k++ {
                        for _, routePath := range t.Routes[k].Path {
                                if key.(string) == routePath {
                                        exist = true
@@ -204,8 +204,8 @@ func (t *Config) SwapSign(ctx context.Context, logger Logger) {
        })
 
        for i := 0; i < len(t.Routes); i++ {
-               if _, ok := t.routeMap.Load(t.Routes[i].Path); !ok {
-                       for _, routePath := range t.Routes[i].Path {
+               for _, routePath := range t.Routes[i].Path {
+                       if _, ok := t.routeMap.Load(routePath); !ok {
                                add(routePath, &t.Routes[i], logger)
                        }
                }