Skip to content

Commit

Permalink
remove bad test from get_updated_dict
Browse files Browse the repository at this point in the history
PR #42328 (21ebabf) already fixed
issue #35217 by removing the bad test. Now also remove the nonsensical
comment condition from loading.jl.
  • Loading branch information
vtjnash committed Sep 28, 2022
1 parent 1afa368 commit 7aff712
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,10 @@ end

function get_updated_dict(p::TOML.Parser, f::CachedTOMLDict)
s = stat(f.path)
time_since_cached = time() - f.mtime
rough_mtime_granularity = 0.1 # seconds
# In case the file is being updated faster than the mtime granularity,
# and have the same size after the update we might miss that it changed. Therefore
# always check the hash in case we recently created the cache.
if time_since_cached < rough_mtime_granularity || s.inode != f.inode || s.mtime != f.mtime || f.size != s.size
# note, this might miss very rapid in-place updates, such that mtime is
# identical but that is solvable by not doing in-place updates, and not
# rapidly changing these files
if s.inode != f.inode || s.mtime != f.mtime || f.size != s.size
content = read(f.path)
new_hash = _crc32c(content)
if new_hash != f.hash
Expand Down

0 comments on commit 7aff712

Please sign in to comment.