You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (s *BaseSearchEx) sortMap(mp map[int32]int) []int32 {
var newMp = make([]int, 0)
var newMpKey = make([]int32, 0)
for oldk, v := range mp {
newMp = append(newMp, v)
newMpKey = append(newMpKey, oldk)
}
sort.Ints(newMp) //排序
list := make([]int32, 0)
for k, _ := range newMp { //这里的k是下标是0到len(newMp)-1,也就是跟for k:=0;k<len(newMp);k++ {一样,上面排序没有用
list = append(list, newMpKey[k])
}
return list
}
The text was updated successfully, but these errors were encountered:
func (s *BaseSearchEx) sortMap(mp map[int32]int) []int32 {
var newMp = make([]int, 0)
var newMpKey = make([]int32, 0)
for oldk, v := range mp {
newMp = append(newMp, v)
newMpKey = append(newMpKey, oldk)
}
sort.Ints(newMp) //排序
}
The text was updated successfully, but these errors were encountered: