We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ebb272a commit a8a4010Copy full SHA for a8a4010
1 file changed
annot.go
@@ -131,11 +131,10 @@ func Write(w io.Writer, annots ...*Annot) error {
131
a.createLines()
132
}
133
134
- // Start with second last annotation index and decrement.
135
- // The last annotation will always be on row=0 and needs
136
- // no adjustment.
137
- for aIdxDecr := len(annots) - 2; 0 <= aIdxDecr; aIdxDecr-- {
138
- setRow(annots[aIdxDecr], annots[aIdxDecr+1:])
+ // Start with second last annotation index. The last annotation
+ // will always be on row=0 and needs no adjustment.
+ for aIdx := range slices.Backward(annots[:len(annots)-1]) {
+ setRow(annots[aIdx], annots[aIdx+1:])
139
140
141
return write(w, annots)
0 commit comments