MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / RemoveDuplicatesAndEmpty

Function RemoveDuplicatesAndEmpty

cli/pkg/common/array.go:95–104  ·  view source on GitHub ↗

** * 数组去重 去空 */

(a []string)

Source from the content-addressed store, hash-verified

93 * 数组去重 去空
94 */
95func RemoveDuplicatesAndEmpty(a []string) (ret []string) {
96 a_len := len(a)
97 for i := 0; i < a_len; i++ {
98 if (i > 0 && a[i-1] == a[i]) || len(a[i]) == 0 {
99 continue
100 }
101 ret = append(ret, a[i])
102 }
103 return
104}

Callers 4

ErrorMethod · 0.85
FatalMethod · 0.85
InfoMethod · 0.85
DebugMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected