1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-04 02:24:12 +02:00

optimize should_parse_message

This commit is contained in:
Robin Appelman 2019-03-17 18:54:53 +01:00
commit f4e4f2e26b
4 changed files with 14 additions and 18 deletions

View file

@ -59,7 +59,7 @@ impl Parse for MessagePacket {
while packet_data.bits_left() > 6 {
let message_type = MessageType::parse(&mut packet_data, state)?;
if state.parse_message_types.contains(&message_type) {
if state.should_parse_message(message_type) {
let message = Message::from_type(message_type, &mut packet_data, state)?;
messages.push(message);
} else {