summaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/chroot/util.go
blob: 34cc772603a4d43af556e310b3699c5d580dd9e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// +build linux

package chroot

func dedupeStringSlice(slice []string) []string {
	done := make([]string, 0, len(slice))
	m := make(map[string]struct{})
	for _, s := range slice {
		if _, present := m[s]; !present {
			m[s] = struct{}{}
			done = append(done, s)
		}
	}
	return done
}