10000 git: update switch cases by hezhizhen · Pull Request #1182 · go-git/go-git · GitHub
[go: up one dir, main page]

Skip to content

git: update switch cases #1182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
git: update switch cases
  • Loading branch information
hezhizhen authored Sep 6, 2024
commit d480074caddf77d9cc8089af6870a8d41062ea80
8 changes: 4 additions & 4 deletions blame.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ func (b *blame) addBlames(curItems []*queueItem) (bool, error) {
for h := range hunks {
hLines := countLines(hunks[h].Text)
for hl := 0; hl < hLines; hl++ {
switch {
case hunks[h].Type == diffmatchpatch.DiffEqual:
switch hunks[h].Type {
case diffmatchpatch.DiffEqual:
prevl++
curl++
if curl == curItem.NeedsMap[need].Cur {
Expand All @@ -319,7 +319,7 @@ func (b *blame) addBlames(curItems []*queueItem) (bool, error) {
break out
}
}
case hunks[h].Type == diffmatchpatch.DiffInsert:
case diffmatchpatch.DiffInsert:
curl++
if curl == curItem.NeedsMap[need].Cur {
// the line we want is added, it may have been added here (or by another parent), skip it for now
Expand All @@ -328,7 +328,7 @@ func (b *blame) addBlames(curItems []*queueItem) (bool, error) {
break out
}
}
case hunks[h].Type == diffmatchpatch.DiffDelete:
case diffmatchpatch.DiffDelete:
prevl += hLines
continue out
default:
Expand Down
Loading
0