mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-03 23:20:25 +08:00
提升IP名单性能
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// 计算版本代号
|
||||
// VersionToLong 计算版本代号
|
||||
func VersionToLong(version string) uint32 {
|
||||
countDots := strings.Count(version, ".")
|
||||
var countDots = strings.Count(version, ".")
|
||||
if countDots == 2 {
|
||||
version += ".0"
|
||||
} else if countDots == 1 {
|
||||
@@ -14,5 +15,5 @@ func VersionToLong(version string) uint32 {
|
||||
} else if countDots == 0 {
|
||||
version += ".0.0.0"
|
||||
}
|
||||
return uint32(IP2Long(version))
|
||||
return uint32(configutils.IPString2Long(version))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user