refactor: use uint8_t for blobs and ga_append() (#21916)

A blob is used as a sequence of bytes and usually accessed individually,
not as as a NUL-terminuated string, so uint8_t should be better.

Not sure about ga_append(), but using uint8_t leads to fewer casts.
This commit is contained in:
zeertzjq
2023-01-21 09:24:09 +08:00
committed by GitHub
parent 1c16d0994d
commit e86d2734a9
10 changed files with 32 additions and 33 deletions

View File

@@ -98,7 +98,7 @@ static void ga_concat_esc(garray_T *gap, const char *p, int clen)
vim_snprintf(buf, NUMBUFLEN, "\\x%02x", *p);
ga_concat(gap, buf);
} else {
ga_append(gap, *p);
ga_append(gap, (uint8_t)(*p));
}
break;
}