comparison rust/hg-core/src/dirstate_tree/status.rs @ 48190:0cc0c0972164

dirstate-v2: Only convert from SystemTime to Timestamp and not back Converting from Timestamp back to SystemTime was only used for equality comparison, but this can also be done on Timestamp values. Differential Revision: https://phab.mercurial-scm.org/D11631
author Simon Sapin <simon.sapin@octobus.net>
date Tue, 12 Oct 2021 15:29:05 +0200
parents 1b2ee68e85f9
children d2f760c2c91c
comparison
equal deleted inserted replaced
48189:6e01bcd111d2 48190:0cc0c0972164
197 // The dirstate contains a cached mtime for this directory, set 197 // The dirstate contains a cached mtime for this directory, set
198 // by a previous run of the `status` algorithm which found this 198 // by a previous run of the `status` algorithm which found this
199 // directory eligible for `read_dir` caching. 199 // directory eligible for `read_dir` caching.
200 if let Some(meta) = directory_metadata { 200 if let Some(meta) = directory_metadata {
201 if let Ok(current_mtime) = meta.modified() { 201 if let Ok(current_mtime) = meta.modified() {
202 if current_mtime == cached_mtime.into() { 202 let current_mtime = Timestamp::from(current_mtime);
203 if current_mtime == *cached_mtime {
203 // The mtime of that directory has not changed 204 // The mtime of that directory has not changed
204 // since then, which means that the results of 205 // since then, which means that the results of
205 // `read_dir` should also be unchanged. 206 // `read_dir` should also be unchanged.
206 return true; 207 return true;
207 } 208 }