Remove Cache dirty-tracking

It really wasn't necessary since Cache#write is not called often.
This commit is contained in:
Josh Holtrop 2019-02-25 21:16:48 -05:00
parent be058dd18b
commit 7cc68b2ce1

View File

@ -85,17 +85,14 @@ module Rscons
@lookup_checksums = {} @lookup_checksums = {}
end end
# Write the cache to disk to be loaded next time. # Write the cache to disk.
# #
# @return [void] # @return [void]
def write def write
if @dirty || (@cache["version"] != VERSION) @cache["version"] = VERSION
@cache["version"] = VERSION File.open(CACHE_FILE, "w") do |fh|
File.open(CACHE_FILE, "w") do |fh| fh.puts(JSON.dump(@cache))
fh.puts(JSON.dump(@cache))
end
end end
@dirty = false
end end
# Check if target(s) are up to date. # Check if target(s) are up to date.
@ -249,7 +246,6 @@ module Rscons
} }
end, end,
} }
@dirty = true
end end
end end
@ -274,7 +270,6 @@ module Rscons
unless File.exists?(subpath) unless File.exists?(subpath)
FileUtils.mkdir_p(subpath) FileUtils.mkdir_p(subpath)
@cache["directories"][subpath] = true @cache["directories"][subpath] = true
@dirty = true
end end
end end
end end
@ -315,7 +310,6 @@ module Rscons
@cache["targets"] ||= {} @cache["targets"] ||= {}
@cache["directories"] ||= {} @cache["directories"] ||= {}
@lookup_checksums = {} @lookup_checksums = {}
@dirty = false
end end
# Return a file's checksum, or the previously calculated checksum for # Return a file's checksum, or the previously calculated checksum for