Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 329d518b authored by Ary Borenszweig's avatar Ary Borenszweig
Browse files

Use File.cmp and File.delete in compiler to avoid system calls.

parent 21c3f01d
Branches
Tags v2017.04
No related merge requests found
......@@ -324,9 +324,8 @@ module Crystal
must_compile = true
if !compiler.llc_flags_changed && File.exists?(bc_name) && File.exists?(o_name)
cmd_output = system "cmp -s #{bc_name} #{bc_name_new}"
if cmd_output == 0
system "rm #{bc_name_new}"
if File.cmp(bc_name, bc_name_new)
File.delete bc_name_new
must_compile = false
end
end
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment