Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2015-11-24 00:35:54 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2015-11-24 00:35:54 +0300
commitb00771ca14ef0b07a1eb6cf71e2511e12b02d0b0 (patch)
treed22ffee26f560d0df801f31933b6ac5abdfa6669 /helpers
parentc3931ef748d1bb0ec60e45e1cecdfc1bde850bfc (diff)
Simplify ExtractRootPaths
Diffstat (limited to 'helpers')
-rw-r--r--helpers/path.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/helpers/path.go b/helpers/path.go
index 07d08fa69..7fb116a77 100644
--- a/helpers/path.go
+++ b/helpers/path.go
@@ -458,13 +458,11 @@ func ExtractRootPaths(paths []string) []string {
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