Skip to content

Commit

Permalink
Avoid moving uniq function
Browse files Browse the repository at this point in the history
  • Loading branch information
jtibshirani committed Nov 14, 2023
1 parent 0ac3b04 commit 852058d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions gitindex/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,18 +860,6 @@ func prepareNormalBuild(options Options, repository *git.Repository) (repos map[
return repos, branchMap, branchVersions, nil
}

func uniq(ss []string) []string {
result := ss[:0]
var last string
for i, s := range ss {
if i == 0 || s != last {
result = append(result, s)
}
last = s
}
return result
}

func createDocument(
key fileKey,
repos map[fileKey]BlobLocation,
Expand Down Expand Up @@ -931,3 +919,15 @@ func blobContents(blob *object.Blob) ([]byte, error) {
}
return buf.Bytes(), nil
}

func uniq(ss []string) []string {
result := ss[:0]
var last string
for i, s := range ss {
if i == 0 || s != last {
result = append(result, s)
}
last = s
}
return result
}

0 comments on commit 852058d

Please sign in to comment.