Merge pull request #2072 from pared/optimize_mtime_and_size

make get_mtime_and_size use single stat call for files
This commit is contained in:
Ruslan Kuprieiev
2019-05-30 03:21:11 +03:00
committed by GitHub
+3 -2
View File
@@ -21,8 +21,9 @@ def get_inode(path):
def get_mtime_and_size(path):
size = os.path.getsize(path)
mtime = os.path.getmtime(path)
stat = os.stat(path)
size = stat.st_size
mtime = stat.st_mtime
if os.path.isdir(path):
for root, dirs, files in dvc_walk(str(path)):