Lines Matching refs:list
648 func FirstUniquePaths(list Paths) Paths {
650 if len(list) > 128 {
651 return firstUniquePathsMap(list)
653 return firstUniquePathsList(list)
658 func SortedUniquePaths(list Paths) Paths {
659 unique := FirstUniquePaths(list)
666 func firstUniquePathsList(list Paths) Paths {
669 for i := 0; i < len(list); i++ {
671 if list[i] == list[j] {
675 list[k] = list[i]
678 return list[:k]
681 func firstUniquePathsMap(list Paths) Paths {
683 seen := make(map[Path]bool, len(list))
684 for i := 0; i < len(list); i++ {
685 if seen[list[i]] {
688 seen[list[i]] = true
689 list[k] = list[i]
692 return list[:k]
697 func FirstUniqueInstallPaths(list InstallPaths) InstallPaths {
699 if len(list) > 128 {
700 return firstUniqueInstallPathsMap(list)
702 return firstUniqueInstallPathsList(list)
705 func firstUniqueInstallPathsList(list InstallPaths) InstallPaths {
708 for i := 0; i < len(list); i++ {
710 if list[i] == list[j] {
714 list[k] = list[i]
717 return list[:k]
720 func firstUniqueInstallPathsMap(list InstallPaths) InstallPaths {
722 seen := make(map[InstallPath]bool, len(list))
723 for i := 0; i < len(list); i++ {
724 if seen[list[i]] {
727 seen[list[i]] = true
728 list[k] = list[i]
731 return list[:k]
736 func LastUniquePaths(list Paths) Paths {
738 for i := len(list) - 1; i >= totalSkip; i-- {
741 if list[i] == list[j] {
744 list[j+skip] = list[j]
749 return list[totalSkip:]
753 func ReversePaths(list Paths) Paths {
754 if list == nil {
757 ret := make(Paths, len(list))
758 for i := range list {
759 ret[i] = list[len(list)-1-i]
764 func indexPathList(s Path, list []Path) int {
765 for i, l := range list {
774 func inPathList(p Path, list []Path) bool {
775 return indexPathList(p, list) != -1
778 func FilterPathList(list []Path, filter []Path) (remainder []Path, filtered []Path) {
779 return FilterPathListPredicate(list, func(p Path) bool { return inPathList(p, filter) })
782 func FilterPathListPredicate(list []Path, predicate func(Path) bool) (remainder []Path, filtered []…
783 for _, l := range list {