summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2019-03-07 02:00:31 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2019-03-07 02:00:31 +0900
commit1a6defdbcc616368080e4fba0c7cd63d809c9939 (patch)
tree04ff2c1984980fa28f3f63c3cd0987ae58dd6b1d /src
parentef577a65094a38f82b2c18dfd3e524eb50748503 (diff)
Use simple string concatenation instead of using fmt.Sprintf
Diffstat (limited to 'src')
-rw-r--r--src/ansi.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ansi.go b/src/ansi.go
index cc458d15..3579b99a 100644
--- a/src/ansi.go
+++ b/src/ansi.go
@@ -2,7 +2,6 @@ package fzf
import (
"bytes"
- "fmt"
"regexp"
"strconv"
"strings"
@@ -72,12 +71,12 @@ func toAnsiString(color tui.Color, offset int) string {
} else if col < 16 {
ret += strconv.Itoa(offset - 30 + 90 + col - 8)
} else if col < 256 {
- ret += fmt.Sprintf("%d;5;%d", offset+8, col)
+ ret += strconv.Itoa(offset+8) + ";5;" + strconv.Itoa(col)
} else if col >= (1 << 24) {
- r := (col >> 16) & 0xff
- g := (col >> 8) & 0xff
- b := col & 0xff
- ret += fmt.Sprintf("%d;2;%d;%d;%d", offset+8, r, g, b)
+ r := strconv.Itoa((col >> 16) & 0xff)
+ g := strconv.Itoa((col >> 8) & 0xff)
+ b := strconv.Itoa(col & 0xff)
+ ret += strconv.Itoa(offset+8) + ";2;" + r + ";" + g + ";" + b
}
return ret + ";"
}