Skip to content

Commit

Permalink
Fix LoadPathCache deduplication
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Feb 22, 2022
1 parent cb1adae commit 4f60408
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bootsnap/load_path_cache/store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def commit_transaction
def load_data
@data = begin
data = File.open(@store_path, encoding: Encoding::BINARY) do |io|
MessagePack.load(io)
MessagePack.load(io, freeze: true)
end
if data.is_a?(Hash) && data[VERSION_KEY] == CURRENT_VERSION
data
Expand Down Expand Up @@ -99,7 +99,7 @@ def dump_data
# `encoding:` looks redundant wrt `binwrite`, but necessary on windows
# because binary is part of mode.
File.open(tmp, mode: exclusive_write, encoding: Encoding::BINARY) do |io|
MessagePack.dump(@data, io, freeze: true)
MessagePack.dump(@data, io)
end
FileUtils.mv(tmp, @store_path)
rescue Errno::EEXIST
Expand Down

0 comments on commit 4f60408

Please sign in to comment.