Skip to content

Commit

Permalink
Micro-optimization
Browse files Browse the repository at this point in the history
Use 31 bits for the index rather than 32bits.
  • Loading branch information
kovidgoyal committed Nov 4, 2024
1 parent bacfb43 commit e54a761
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kitty/line.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ static_assert(sizeof(GPUCell) == 20, "Fix the ordering of GPUCell");

typedef union CPUCell {
struct {
char_type ch_or_idx: sizeof(char_type) * 8;
hyperlink_id_type hyperlink_id: sizeof(hyperlink_id_type) * 8;
bool ch_is_idx: 1;
uint16_t : 15;
char_type ch_or_idx: sizeof(char_type) * 8 - 1;
hyperlink_id_type hyperlink_id: sizeof(hyperlink_id_type) * 8;
uint16_t : 16;
};
uint64_t val;
} CPUCell;
Expand Down

0 comments on commit e54a761

Please sign in to comment.