ref: b00771ca14ef0b07a1eb6cf71e2511e12b02d0b0
parent: c3931ef748d1bb0ec60e45e1cecdfc1bde850bfc
author: Bjørn Erik Pedersen <[email protected]>
date: Mon Nov 23 17:35:54 EST 2015
Simplify ExtractRootPaths
--- a/helpers/path.go
+++ b/helpers/path.go
@@ -458,13 +458,11 @@
r := make([]string, len(paths))
for i, p := range paths {
root := filepath.ToSlash(p)
- if strings.Contains(root, "/") {
- sections := strings.Split(root, "/")
- for _, section := range sections {
- if section != "" {
- root = section
- break
- }
+ sections := strings.Split(root, "/")
+ for _, section := range sections {
+ if section != "" {
+ root = section
+ break
}
}
r[i] = root