mirror of
https://github.com/RGBCube/cstree
synced 2025-07-27 09:07:44 +00:00
slightly adjust green token caching
This commit is contained in:
parent
c539674fc7
commit
7d71c7d150
1 changed files with 4 additions and 1 deletions
|
@ -185,7 +185,10 @@ where
|
|||
let text_len = TextSize::try_from(text.len()).unwrap();
|
||||
let text = self.interner.get_or_intern(text);
|
||||
let data = GreenTokenData { kind, text, text_len };
|
||||
self.tokens.entry(data).or_insert_with(|| GreenToken::new(data)).clone()
|
||||
self.tokens
|
||||
.entry(data)
|
||||
.or_insert_with_key(|data| GreenToken::new(*data))
|
||||
.clone()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue