diff options
author | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-16 12:17:35 +0800 |
---|---|---|
committer | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-16 12:17:35 +0800 |
commit | d9dcbd0f89c1267f272f3cd7e9f9dd69d0ae145b (patch) | |
tree | 2e367e52c907c60c789de30abc063539355497ad /src/interactive/app/common.rs | |
parent | 81dc53b0e6d7c292909610fba6fd030ed6b01917 (diff) |
performance improvementsv2.1.2
Diffstat (limited to 'src/interactive/app/common.rs')
-rw-r--r-- | src/interactive/app/common.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/interactive/app/common.rs b/src/interactive/app/common.rs index c612f28..6338f25 100644 --- a/src/interactive/app/common.rs +++ b/src/interactive/app/common.rs @@ -39,11 +39,12 @@ pub fn sorted_entries(tree: &Tree, node_idx: TreeIndex, sorting: SortMode) -> Ve .filter_map(|idx| { tree.node_weight(idx).map(|w| { let p = path_of(tree, idx); + let pm = p.metadata(); EntryDataBundle { index: idx, data: w.clone(), - is_dir: p.is_dir(), - exists: p.exists(), + exists: pm.is_ok(), + is_dir: pm.ok().map_or(false, |m| m.is_dir()), } }) }) |