1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Add reverse list

This commit is contained in:
Zack Scholl
2017-03-24 06:25:59 -06:00
parent 7b096e6013
commit f45b4f86ca
2 changed files with 23 additions and 0 deletions

View File

@ -247,3 +247,16 @@ func decodeFromBase32(s string) (s2 string, err error) {
s2 = string(bString)
return
}
func reverseSliceInt64(s []int64) []int64 {
for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
s[i], s[j] = s[j], s[i]
}
return s
}
func reverseSliceString(s []string) []string {
for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
s[i], s[j] = s[j], s[i]
}
return s
}