Skip to content

Commit 92093ce

Browse files
committed
Fix warning QF1003: could use tagged switch
1 parent c7d0aaa commit 92093ce

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pkg/gui/controllers/list_controller.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@ func (self *ListController) handleLineChangeAux(f func(int), change int) error {
109109
// we're not constantly re-rendering the main view.
110110
cursorMoved := before != after
111111
if cursorMoved {
112-
if change == -1 {
112+
switch change {
113+
case -1:
113114
checkScrollUp(self.context.GetViewTrait(), self.c.UserConfig(),
114115
self.context.ModelIndexToViewIndex(before), self.context.ModelIndexToViewIndex(after))
115-
} else if change == 1 {
116+
case 1:
116117
checkScrollDown(self.context.GetViewTrait(), self.c.UserConfig(),
117118
self.context.ModelIndexToViewIndex(before), self.context.ModelIndexToViewIndex(after))
118119
}

pkg/gui/presentation/files.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ func getFileLine(
185185
func formatFileStatus(file *models.File, restColor style.TextStyle) string {
186186
firstChar := file.ShortStatus[0:1]
187187
firstCharCl := style.FgGreen
188-
if firstChar == "?" {
188+
switch firstChar {
189+
case "?":
189190
firstCharCl = theme.UnstagedChangesColor
190-
} else if firstChar == " " {
191+
case " ":
191192
firstCharCl = restColor
192193
}
193194

0 commit comments

Comments
 (0)