summaryrefslogtreecommitdiff
path: root/cli/cache
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-08-26 19:59:17 -0400
committerGitHub <noreply@github.com>2024-08-26 23:59:17 +0000
commitc89a20b42899abff5c3ea84660c8110806c5fbee (patch)
treee9d93ce49b391faf0058bd3223ba72d398f78fc8 /cli/cache
parente13230226fe91498b3a5f28a8de6edbe4f164944 (diff)
perf(cache): single cache file for remote modules (#24983)
This changes the global cache to store the cache file for remote modules in one file instead of two.
Diffstat (limited to 'cli/cache')
-rw-r--r--cli/cache/mod.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/cli/cache/mod.rs b/cli/cache/mod.rs
index 772d2359d..cc183530d 100644
--- a/cli/cache/mod.rs
+++ b/cli/cache/mod.rs
@@ -62,12 +62,8 @@ pub const CACHE_PERM: u32 = 0o644;
pub struct RealDenoCacheEnv;
impl deno_cache_dir::DenoCacheEnv for RealDenoCacheEnv {
- fn read_file_bytes(&self, path: &Path) -> std::io::Result<Option<Vec<u8>>> {
- match std::fs::read(path) {
- Ok(s) => Ok(Some(s)),
- Err(err) if err.kind() == std::io::ErrorKind::NotFound => Ok(None),
- Err(err) => Err(err),
- }
+ fn read_file_bytes(&self, path: &Path) -> std::io::Result<Vec<u8>> {
+ std::fs::read(path)
}
fn atomic_write_file(