From 25a9f121b5f6777414f65d5693226de083d78e92 Mon Sep 17 00:00:00 2001 From: Kemal Zebari Date: Sat, 11 May 2024 16:09:40 -0700 Subject: [PATCH] Shrink openEmailBracketIdx -> openBracketIdx --- services/repository/contributors_graph.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/repository/contributors_graph.go b/services/repository/contributors_graph.go index c22225f716..e1423d5989 100644 --- a/services/repository/contributors_graph.go +++ b/services/repository/contributors_graph.go @@ -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 }