summaryrefslogtreecommitdiff
path: root/src/result.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/result.go')
-rw-r--r--src/result.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/result.go b/src/result.go
index 0ad0994e..36f56fb7 100644
--- a/src/result.go
+++ b/src/result.go
@@ -128,9 +128,9 @@ func (result *Result) colorOffsets(matchOffsets []Offset, nthOffsets []Offset, t
// No ANSI codes
if len(itemColors) == 0 && len(nthOffsets) == 0 {
- var offsets []colorOffset
- for _, off := range matchOffsets {
- offsets = append(offsets, colorOffset{offset: [2]int32{off[0], off[1]}, color: colMatch, match: true})
+ offsets := make([]colorOffset, len(matchOffsets))
+ for i, off := range matchOffsets {
+ offsets[i] = colorOffset{offset: [2]int32{off[0], off[1]}, color: colMatch, match: true}
}
return offsets
}