Remove redundant `len` check in `GroupSheets` and `UngroupSheets` (#1685)
This commit is contained in:
parent
d9a0da7b48
commit
f752f2ddf4
13
sheet.go
13
sheet.go
|
@ -1739,11 +1739,8 @@ func (f *File) GroupSheets(sheets []string) error {
|
|||
}
|
||||
for _, ws := range wss {
|
||||
sheetViews := ws.SheetViews.SheetView
|
||||
if len(sheetViews) > 0 {
|
||||
for idx := range sheetViews {
|
||||
ws.SheetViews.SheetView[idx].TabSelected = true
|
||||
}
|
||||
continue
|
||||
for idx := range sheetViews {
|
||||
ws.SheetViews.SheetView[idx].TabSelected = true
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
@ -1758,10 +1755,8 @@ func (f *File) UngroupSheets() error {
|
|||
}
|
||||
ws, _ := f.workSheetReader(sheet)
|
||||
sheetViews := ws.SheetViews.SheetView
|
||||
if len(sheetViews) > 0 {
|
||||
for idx := range sheetViews {
|
||||
ws.SheetViews.SheetView[idx].TabSelected = false
|
||||
}
|
||||
for idx := range sheetViews {
|
||||
ws.SheetViews.SheetView[idx].TabSelected = false
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue