mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Some code improvements
* Some assignments simplified by using assignment operators * Rewrite switch statement with only one case as if. * Rewrite if-else chain as a switch statement. * go fmt `modules/todoist/project.go` file.
This commit is contained in:
@@ -20,13 +20,13 @@ func (widget *Widget) display() {
|
||||
offset := 0
|
||||
|
||||
for idx, item := range widget.list.UncheckedItems() {
|
||||
str = str + widget.formattedItemLine(idx, item, widget.list.SelectedItem(), widget.list.LongestLine())
|
||||
str += widget.formattedItemLine(idx, item, widget.list.SelectedItem(), widget.list.LongestLine())
|
||||
newList.Items = append(newList.Items, item)
|
||||
offset++
|
||||
}
|
||||
|
||||
for idx, item := range widget.list.CheckedItems() {
|
||||
str = str + widget.formattedItemLine(idx+offset, item, widget.list.SelectedItem(), widget.list.LongestLine())
|
||||
str += widget.formattedItemLine(idx+offset, item, widget.list.SelectedItem(), widget.list.LongestLine())
|
||||
newList.Items = append(newList.Items, item)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user