mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 21:25:25 +00:00
Preallocate parser::Input
This commit is contained in:
parent
5ff4ba347d
commit
8bff414abc
3 changed files with 10 additions and 3 deletions
|
|
@ -27,7 +27,7 @@ pub enum StrStep<'a> {
|
|||
impl LexedStr<'_> {
|
||||
pub fn to_input(&self, edition: Edition) -> crate::Input {
|
||||
let _p = tracing::info_span!("LexedStr::to_input").entered();
|
||||
let mut res = crate::Input::default();
|
||||
let mut res = crate::Input::with_capacity(self.len());
|
||||
let mut was_joint = false;
|
||||
for i in 0..self.len() {
|
||||
let kind = self.kind(i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue