From 7cc68b2ce17c5da31ddd83bbdb701fa42759a9fa Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 25 Feb 2019 21:16:48 -0500 Subject: [PATCH] Remove Cache dirty-tracking It really wasn't necessary since Cache#write is not called often. --- lib/rscons/cache.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/rscons/cache.rb b/lib/rscons/cache.rb index 1180571..d7f3502 100644 --- a/lib/rscons/cache.rb +++ b/lib/rscons/cache.rb @@ -85,17 +85,14 @@ module Rscons @lookup_checksums = {} end - # Write the cache to disk to be loaded next time. + # Write the cache to disk. # # @return [void] def write - if @dirty || (@cache["version"] != VERSION) - @cache["version"] = VERSION - File.open(CACHE_FILE, "w") do |fh| - fh.puts(JSON.dump(@cache)) - end + @cache["version"] = VERSION + File.open(CACHE_FILE, "w") do |fh| + fh.puts(JSON.dump(@cache)) end - @dirty = false end # Check if target(s) are up to date. @@ -249,7 +246,6 @@ module Rscons } end, } - @dirty = true end end @@ -274,7 +270,6 @@ module Rscons unless File.exists?(subpath) FileUtils.mkdir_p(subpath) @cache["directories"][subpath] = true - @dirty = true end end end @@ -315,7 +310,6 @@ module Rscons @cache["targets"] ||= {} @cache["directories"] ||= {} @lookup_checksums = {} - @dirty = false end # Return a file's checksum, or the previously calculated checksum for