faster text len

This commit is contained in:
Aleksey Kladov
2018-09-03 21:48:26 +03:00
parent 5ba645c009
commit f590635f57
2 changed files with 2 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ impl GreenNode {
pub fn text_len(&self) -> TextUnit {
match self {
GreenNode::Leaf { text, .. } => TextUnit::of_str(text.as_str()),
GreenNode::Leaf { text, .. } => TextUnit::from(text.len() as u32),
GreenNode::Branch(b) => b.text_len(),
}
}