Skip to content

Commit

Permalink
Shrink openEmailBracketIdx -> openBracketIdx
Browse files Browse the repository at this point in the history
  • Loading branch information
kemzeb committed May 11, 2024
1 parent cce7812 commit 25a9f12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions services/repository/contributors_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,17 @@ func parseCoAuthorTrailerValue(value string) (name, email string, err error) {
}

closedBracketIdx := len(value) - 1
openEmailBracketIdx := strings.LastIndex(value, "<")
if openEmailBracketIdx == -1 {
openBracketIdx := strings.LastIndex(value, "<")
if openBracketIdx == -1 {
return "", "", errSyntax
}

email = value[openEmailBracketIdx+1 : closedBracketIdx]
email = value[openBracketIdx+1 : closedBracketIdx]
if _, err := mail.ParseAddress(email); err != nil {
return "", "", err
}

name = strings.TrimSpace(value[:openEmailBracketIdx])
name = strings.TrimSpace(value[:openBracketIdx])
if len(name) == 0 {
return "", "", errSyntax
}
Expand Down

0 comments on commit 25a9f12

Please sign in to comment.