From a8923534ed02e9e4ba3bb277db6e61a208c64125 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 28 May 2024 23:40:40 -0400 Subject: 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 --- cli/args/lockfile.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cli/args') 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 { } 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(()) } -- cgit v1.2.3