Skip to content

Commit

Permalink
Slight (3 ns) speed improvement thanks to JohnH in https://users.rust…
Browse files Browse the repository at this point in the history
  • Loading branch information
matiu2 committed Jul 12, 2019
1 parent a90e78a commit c5f9c2c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/header/name.rs
Expand Up @@ -1072,9 +1072,7 @@ fn parse_hdr<'a>(
len if len > 64 => Ok(HdrName::custom(data, false)),
len => {
// Read from data into the buffer - transforming using `table` as we go
for i in 0..len {
b[i] = table[data[i] as usize]
}
data.iter().zip(b.iter_mut()).for_each(|(index, out)| *out = table[*index as usize]);
match &b[0..len] {
b"te" => Ok(Te.into()),
b"age" => Ok(Age.into()),
Expand Down

0 comments on commit c5f9c2c

Please sign in to comment.