mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-06 07:15:30 -04:00
term: performance: use a bitfield to track which ascii printer to use
The things affecting which ASCII printer we use have grown... Instead of checking everything inside term_update_ascii_printer(), use a bitfield. Anything affecting the printer used, must now set a bit in this bitfield. This makes term_update_ascii_printer() much faster, since all it needs to do is check if the bitfield is zero or not.
This commit is contained in:
parent
22302d8bcc
commit
48cf57818d
5 changed files with 63 additions and 13 deletions
11
terminal.h
11
terminal.h
|
|
@ -393,6 +393,17 @@ struct terminal {
|
|||
const struct config *conf;
|
||||
|
||||
void (*ascii_printer)(struct terminal *term, char32_t c);
|
||||
union {
|
||||
struct {
|
||||
bool sixels:1;
|
||||
bool osc8:1;
|
||||
bool curly_style:1;
|
||||
bool curly_color:1;
|
||||
bool insert_mode:1;
|
||||
bool charset:1;
|
||||
};
|
||||
uint8_t value;
|
||||
} bits_affecting_ascii_printer;
|
||||
|
||||
pid_t slave;
|
||||
int ptmx;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue