mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
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:
+3
-2
@@ -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)):
|
||||
|
||||
Reference in New Issue
Block a user