diff options
| author | Loyalsoldier <[email protected]> | 2024-08-06 10:40:21 +0800 |
|---|---|---|
| committer | Loyalsoldier <[email protected]> | 2024-08-06 10:40:21 +0800 |
| commit | 1af42dfeb218dc99ea76b6cc4046ff007c32b5e0 (patch) | |
| tree | db478bd0c5df5a5bd31b26ac8e93f9173ad51cf8 /plugin/maxmind | |
| parent | 18e14e610c29c745c6fb98002d352c19e1105b73 (diff) | |
Chore: sort output lists
Diffstat (limited to 'plugin/maxmind')
| -rw-r--r-- | plugin/maxmind/mmdb_out.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugin/maxmind/mmdb_out.go b/plugin/maxmind/mmdb_out.go index 8bdaab20..5b838463 100644 --- a/plugin/maxmind/mmdb_out.go +++ b/plugin/maxmind/mmdb_out.go @@ -7,6 +7,7 @@ import ( "net" "os" "path/filepath" + "slices" "strings" "github.com/Loyalsoldier/geoip/lib" @@ -159,7 +160,7 @@ func (m *mmdbOut) getEntryNameListInOrder(container lib.Container) []string { } } - list := make([]string, 0, 200) + list := make([]string, 0, 300) for entry := range container.Loop() { name := entry.GetName() _, found := overwriteMap[name] @@ -169,6 +170,9 @@ func (m *mmdbOut) getEntryNameListInOrder(container lib.Container) []string { list = append(list, name) } + // Sort the lists + slices.Sort(list) + // Make sure the names in overwriteList are written at last list = append(list, overwriteList...) |
