Skip to content
Myr

Use simple string concatenation instead of using fmt.Sprintf

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent ef577a6 · Browse files · 1 file+5 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−6 removed

  • other:+5 added−6 removed

1 file+5 added−6 removed

modified:src/ansi.go+5 added-6 removed
1package fzf23import (4 "bytes"5 "fmt"5 "regexp"6 "strconv"7 "strings"8 "unicode/utf8"
61 unmodified lines
70 ret += strconv.Itoa(offset + col)71 } else if col < 16 {72 ret += strconv.Itoa(offset - 30 + 90 + col - 8)73 } else if col < 256 {75 ret += fmt.Sprintf("%d;5;%d", offset+8, col)74 ret += strconv.Itoa(offset+8) + ";5;" + strconv.Itoa(col)75 } else if col >= (1 << 24) {77 r := (col >> 16) & 0xff78 g := (col >> 8) & 0xff79 b := col & 0xff80 ret += fmt.Sprintf("%d;2;%d;%d;%d", offset+8, r, g, b)76 r := strconv.Itoa((col >> 16) & 0xff)77 g := strconv.Itoa((col >> 8) & 0xff)78 b := strconv.Itoa(col & 0xff)79 ret += strconv.Itoa(offset+8) + ";2;" + r + ";" + g + ";" + b80 }81 return ret + ";"82}83
204 unmodified lines