mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-04 02:39:32 +00:00
Preallocate parser::Input
This commit is contained in:
parent
5ff4ba347d
commit
8bff414abc
3 changed files with 10 additions and 3 deletions
|
@ -12,7 +12,7 @@ pub fn to_parser_input<Ctx: Copy + fmt::Debug + PartialEq + Eq + Hash>(
|
|||
buffer: tt::TokenTreesView<'_, SpanData<Ctx>>,
|
||||
span_to_edition: &mut dyn FnMut(Ctx) -> Edition,
|
||||
) -> parser::Input {
|
||||
let mut res = parser::Input::default();
|
||||
let mut res = parser::Input::with_capacity(buffer.len());
|
||||
|
||||
let mut current = buffer.cursor();
|
||||
let mut syntax_context_to_edition_cache = FxHashMap::default();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue