MCPcopy Create free account
hub / github.com/codechenx/FastTableViewer / uniqueChar

Function uniqueChar

sepDector.go:203–213  ·  view source on GitHub ↗

remove duplication item in []rune

(intSlice []rune)

Source from the content-addressed store, hash-verified

201
202// remove duplication item in []rune
203func uniqueChar(intSlice []rune) []rune {
204 keys := make(map[rune]bool)
205 var list []rune
206 for _, entry := range intSlice {
207 if _, value := keys[entry]; !value {
208 keys[entry] = true
209 list = append(list, entry)
210 }
211 }
212 return list
213}
214
215// check if all item in []int is equal, false for empty array
216func allIntItemEqual(r []int) bool {

Callers 1

TestUniqueCharFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestUniqueCharFunction · 0.68