Skip to content

Commit

Permalink
perf(colors): use indexed slice instead of map
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMarble committed Mar 12, 2022
1 parent 35185af commit 739e6e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/color/colors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/color/colorsgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ var packageTemplate = template.Must(template.New("").Funcs(customFuncs).Parse(`/
// {{ .Timestamp }}
package color
var ansiColors = map[int]string{
var ansiColors = []string{
{{- range $index, $element := .AnsiColors }}
{{ printf "%-4s%q" (colon $index) (hex $element)}},
{{- end }}
}
var xtermColors = map[int]string{
var xtermColors = []string{
{{- range $index, $element := .XtermColors }}
{{ printf "%-5s%q" (colon $index) $element}},
{{- end }}
Expand Down

0 comments on commit 739e6e0

Please sign in to comment.