mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
optimize pickString
This commit is contained in:
parent
edc5bbbb72
commit
dc0cbce6e1
@ -35,10 +35,14 @@ func (this *Status) GetReason() string {
|
||||
|
||||
func pickString(arr []string) string {
|
||||
n := len(arr)
|
||||
if n == 0 {
|
||||
switch n {
|
||||
case 0:
|
||||
return ""
|
||||
case 1:
|
||||
return arr[0]
|
||||
default:
|
||||
return arr[dice.Roll(n)]
|
||||
}
|
||||
return arr[dice.Roll(n)]
|
||||
}
|
||||
|
||||
func (this *RequestConfig) PickUri() string {
|
||||
|
Loading…
Reference in New Issue
Block a user