refactor(channel_cache): improve channel selection logic by handling zero total weight and removing unnecessary variable

This commit is contained in:
CaIon
2025-10-29 21:49:06 +08:00
parent 8297723d91
commit b2de5e229c
2 changed files with 15 additions and 24 deletions

View File

@@ -230,10 +230,6 @@ func GetUUID() string {
const keyChars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
func init() {
rand.New(rand.NewSource(time.Now().UnixNano()))
}
func GenerateRandomCharsKey(length int) (string, error) {
b := make([]byte, length)
maxI := big.NewInt(int64(len(keyChars)))