mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-06 20:42:10 +00:00
perf: use .next_back()
to get the last component
Using `.last()` needs to go through all components first instead of splitting only the last one.
This commit is contained in:
parent
9048e80fed
commit
39bdd5eb3f
1 changed files with 1 additions and 1 deletions
|
@ -212,7 +212,7 @@ pub fn run_mergetool_external(
|
|||
};
|
||||
|
||||
let temp_dir = new_utf8_temp_dir("jj-resolve-").map_err(ExternalToolError::SetUpDir)?;
|
||||
let suffix = if let Some(filename) = repo_path.components().last() {
|
||||
let suffix = if let Some(filename) = repo_path.components().next_back() {
|
||||
let name = filename
|
||||
.to_fs_name()
|
||||
.map_err(|err| err.with_path(repo_path))?;
|
||||
|
|
Loading…
Reference in a new issue