buildFilePathMap creates a map of cleaned file paths for efficient lookup. Returns nil if the input slice is empty.
(files []string)
| 1101 | // buildFilePathMap creates a map of cleaned file paths for efficient lookup. |
| 1102 | // Returns nil if the input slice is empty. |
| 1103 | func buildFilePathMap(files []string) map[string]struct{} { |
| 1104 | if len(files) == 0 { |
| 1105 | return nil |
| 1106 | } |
| 1107 | filesMap := make(map[string]struct{}, len(files)) |
| 1108 | for _, f := range files { |
| 1109 | filesMap[filepath.Clean(f)] = struct{}{} |
| 1110 | } |
| 1111 | return filesMap |
| 1112 | } |
no test coverage detected
searching dependent graphs…