Skip to content

Commit 08a19d7

Browse files
authored
perf: use path.as_os_str().hash() instead of path.hash() (#316)
perf: try `path.as_os_str().hash()` instead of `path.hash()`
1 parent 6e45c48 commit 08a19d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<Fs: FileSystem> Cache<Fs> {
4444
pub fn value(&self, path: &Path) -> CachedPath {
4545
let hash = {
4646
let mut hasher = FxHasher::default();
47-
path.hash(&mut hasher);
47+
path.as_os_str().hash(&mut hasher);
4848
hasher.finish()
4949
};
5050
if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) {

0 commit comments

Comments
 (0)