From 7894ec75a7070591c3499fce1f409563c4edc7d7 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Wed, 20 Jul 2022 12:34:06 +0200 Subject: Refactor to use less vecs for events --- src/construct/attention.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/construct/attention.rs') diff --git a/src/construct/attention.rs b/src/construct/attention.rs index 7e99600..2cbc563 100644 --- a/src/construct/attention.rs +++ b/src/construct/attention.rs @@ -205,7 +205,7 @@ fn inside(tokenizer: &mut Tokenizer, code: Code, marker: MarkerKind) -> StateFnR /// Resolve attention sequences. #[allow(clippy::too_many_lines)] -fn resolve_attention(tokenizer: &mut Tokenizer) -> Vec { +fn resolve_attention(tokenizer: &mut Tokenizer) { let codes = &tokenizer.parse_state.codes; let mut edit_map = EditMap::new(); let mut start = 0; @@ -523,7 +523,7 @@ fn resolve_attention(tokenizer: &mut Tokenizer) -> Vec { index += 1; } - edit_map.consume(tokenizer.events.split_off(0)) + edit_map.consume(&mut tokenizer.events); } /// Classify whether a character code represents whitespace, punctuation, or -- cgit