diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2024-12-29 00:18:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-29 00:18:14 +0300 |
commit | 40af63902e0af313722dfdc19a6d10a1d2ba29f4 (patch) | |
tree | db577463eb1d0ed8cbc18f32f6050000e2d5b702 /src/definitions.rs | |
parent | ebc4a4d7259678a8626f5c269ea9348dfc3e79b2 (diff) | |
download | r-alacritty-vte-40af63902e0af313722dfdc19a6d10a1d2ba29f4.tar.gz r-alacritty-vte-40af63902e0af313722dfdc19a6d10a1d2ba29f4.tar.bz2 r-alacritty-vte-40af63902e0af313722dfdc19a6d10a1d2ba29f4.zip |
Improve attrs_from_sgr_parameters performance
Instead of collecting all the data into the vector just dispatch it
right away avoiding allocations.
Diffstat (limited to 'src/definitions.rs')
-rw-r--r-- | src/definitions.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/definitions.rs b/src/definitions.rs index 218c1eb..568a8a8 100644 --- a/src/definitions.rs +++ b/src/definitions.rs @@ -57,9 +57,9 @@ pub fn unpack(delta: u8) -> (State, Action) { unsafe { ( // State is stored in bottom 4 bits - mem::transmute(delta & 0x0f), + mem::transmute::<u8, State>(delta & 0x0f), // Action is stored in top 4 bits - mem::transmute(delta >> 4), + mem::transmute::<u8, Action>(delta >> 4), ) } } |