Skip to content

Commit

Permalink
Get rid of ByteLoader from csi_parse_loop
Browse files Browse the repository at this point in the history
It benchmark's 4% slower on my machine
  • Loading branch information
kovidgoyal committed Nov 17, 2023
1 parent ea4b644 commit ff4d3ef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kitty/vt-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,8 @@ csi_add_digit(ParsedCSI *csi, uint8_t ch) {

static bool
csi_parse_loop(PS *self, ParsedCSI *csi, const uint8_t *buf, size_t *pos, const size_t sz, const size_t start) {
ByteLoader b; byte_loader_init(&b, buf + *pos, sz);
while (*pos < sz) {
const uint8_t ch = byte_loader_next(&b); *pos += 1;
const uint8_t ch = buf[*pos]; *pos += 1;
switch(csi->state) {
case CSI_START:
switch (ch) {
Expand Down

0 comments on commit ff4d3ef

Please sign in to comment.