Skip to content

Commit

Permalink
perf: Speedup Symbol::module
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed May 17, 2019
1 parent 725d82b commit 9566a37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ impl Name {

pub fn module(&self) -> &Name {
let s = self.0.trim_end_matches(|c| c != '.');
Name::new(s.trim_end_matches('.'))
Name::new(if s.is_empty() { s } else { &s[..s.len() - 1] })
}

pub fn name(&self) -> &Name {
Expand Down

0 comments on commit 9566a37

Please sign in to comment.