1 Star 0 Fork 0

纸喵软件 / gutils

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
parameter.go 333 Bytes
Copy Edit Raw Blame History
倒霉狐狸 authored 2020-08-26 22:41 +08:00 . 调整结构,升级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
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhimiao/gutils.git
git@gitee.com:zhimiao/gutils.git
zhimiao
gutils
gutils
82b352082121

Search