From 2908afbd6a9222b718c0f910edfbe2fc5943aad8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 28 Nov 2021 10:21:09 +0200 Subject: Avoid unnecessary work in depdb::close() if using static check_mtime() --- libbuild2/depdb.hxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libbuild2/depdb.hxx') diff --git a/libbuild2/depdb.hxx b/libbuild2/depdb.hxx index 9cff281..5b5052d 100644 --- a/libbuild2/depdb.hxx +++ b/libbuild2/depdb.hxx @@ -118,10 +118,12 @@ namespace build2 // function will "chop off" lines that haven't been read. // // Make sure to also call check_mtime() after updating the target to - // perform the target/database modification times sanity checks. + // perform the target/database modification times sanity checks. Pass + // false to close() to avoid unnecessary work if using the static version + // of check_mtime() (or not using it at all for some reason). // void - close (); + close (bool mtime_check = true); // Flush any unwritten data to disk. This is primarily useful when reusing // a (partially written) database as an input to external programs (e.g., -- cgit v1.1