1 Star 0 Fork 0

纸喵软件 / gutils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
parameter.go 333 Bytes
一键复制 编辑 原始数据 按行查看 历史
倒霉狐狸 提交于 2020-08-26 22:41 . 调整结构,升级rsa加密
package gutils
import "sort"
// IdsUniqueFitter ids去重
func IdsUniqueFitter(ids []int) []int {
sort.Ints(ids)
var newIds []int
var lastID int
for i, id := range ids {
if i == 0 {
lastID = id
newIds = append(newIds, id)
} else if id != lastID {
lastID = id
newIds = append(newIds, id)
}
}
return newIds
}
1
https://gitee.com/zhimiao/gutils.git
git@gitee.com:zhimiao/gutils.git
zhimiao
gutils
gutils
82b352082121

搜索帮助