refactor: remove redundant length property

This commit is contained in:
Jan De Dobbeleer 2022-03-01 19:02:23 +01:00 committed by Jan De Dobbeleer
parent 8b5b8dac65
commit d5da06e33d

View file

@ -41,7 +41,6 @@ type Block struct {
ansi *color.Ansi
activeSegment *Segment
previousActiveSegment *Segment
length int
}
func (b *Block) init(env environment.Environment, writer color.Writer, ansi *color.Ansi) {
@ -178,7 +177,7 @@ func (b *Block) debug() (int, []*SegmentTiming) {
segmentTiming.text = segment.text
if segmentTiming.active {
b.renderSegment(segment)
segmentTiming.text, b.length = b.writer.String()
segmentTiming.text, _ = b.writer.String()
b.writer.Reset()
}
segmentTiming.duration = time.Since(start)