forked from mirrors/gecko-dev
Bug 1896688 - Prevent unnecessary os.stat call in jar.py r=sergesanspaille
If the destination file doesn't exist, we don't need to check the current file's time, and we can just write or symlink regardless. Differential Revision: https://phabricator.services.mozilla.com/D210330
This commit is contained in:
parent
57ae4a3404
commit
2366f9e588
1 changed files with 3 additions and 1 deletions
|
|
@ -517,7 +517,9 @@ class JarMaker(object):
|
|||
|
||||
# copy or symlink if newer
|
||||
|
||||
if getModTime(realsrc) > outHelper.getDestModTime(e.output):
|
||||
# if the output doesn't exist, we can skip an os.stat call
|
||||
out_mod_time = outHelper.getDestModTime(e.output)
|
||||
if out_mod_time == localtime(0) or getModTime(realsrc) > out_mod_time:
|
||||
if self.outputFormat == "symlink":
|
||||
outHelper.symlink(realsrc, out)
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue