Refactor the code to remove global variables

This commit is contained in:
Junegunn Choi committed 2024-05-07 16:58:17 +09:00
1 parent c5fb0c43f9
commit 4bedd33c59
7 files changed
+85 -76

No files matched your search

+1 -1
View File
@@ -312,7 +312,7 @@ func parseAnsiCode(s string, delimiter byte) (int, byte, string) {
// Inlined version of strconv.Atoi() that only handles positive
// integers and does not allocate on error.
code := 0
for _, ch := range sbytes(s) {
for _, ch := range stringBytes(s) {
ch -= '0'
if ch > 9 {
return -1, delimiter, remaining