diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2024-05-28 23:40:40 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-28 23:40:40 -0400 |
| commit | a8923534ed02e9e4ba3bb277db6e61a208c64125 (patch) | |
| tree | a745ab2d0d57df6c21486181a21e9cbeeadd9532 /cli/args | |
| parent | 14a74600de6f1c206ffe4750f6cb6da59657db8e (diff) | |
chore: set lockfile as having no content changes after write (#24023)
Slight perf regression when updating deno_lockfile in
https://github.com/denoland/deno/pull/23979
Diffstat (limited to 'cli/args')
| -rw-r--r-- | cli/args/lockfile.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/args/lockfile.rs b/cli/args/lockfile.rs index 79d139487..30e91eb92 100644 --- a/cli/args/lockfile.rs +++ b/cli/args/lockfile.rs @@ -77,7 +77,7 @@ pub fn read_lockfile_at_path(filename: PathBuf) -> Result<Lockfile, AnyError> { } pub fn write_lockfile_if_has_changes( - lockfile: &Lockfile, + lockfile: &mut Lockfile, ) -> Result<(), AnyError> { let Some(bytes) = lockfile.resolve_write_bytes() else { return Ok(()); // nothing to do @@ -85,5 +85,7 @@ pub fn write_lockfile_if_has_changes( // do an atomic write to reduce the chance of multiple deno // processes corrupting the file atomic_write_file(&lockfile.filename, bytes, cache::CACHE_PERM) - .context("Failed writing lockfile.") + .context("Failed writing lockfile.")?; + lockfile.has_content_changed = false; + Ok(()) } |
