优化代码

This commit is contained in:
GoEdgeLab
2022-09-18 16:18:31 +08:00
parent 994f7c097b
commit 1fff989ad3
19 changed files with 10 additions and 115 deletions

View File

@@ -2,13 +2,9 @@
package expires
import "sync"
type IdKeyMap struct {
idKeys map[int64]string // id => key
keyIds map[string]int64 // key => id
locker sync.Mutex
}
func NewIdKeyMap() *IdKeyMap {

View File

@@ -5,12 +5,9 @@ import (
"github.com/cespare/xxhash"
"math"
"net"
"regexp"
"strings"
)
var ipv4Reg = regexp.MustCompile(`\d+\.`)
// IP2Long 将IP转换为整型
// 注意IPv6没有顺序
func IP2Long(ip string) uint64 {