shelve: use listdir() instead of readdir() when we don't need stat information
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 11 Jan 2021 10:35:52 -0800
changeset 46290 e33266b916be
parent 46289 c062874a35db
child 46291 e2713c68b477
shelve: use listdir() instead of readdir() when we don't need stat information Differential Revision: https://phab.mercurial-scm.org/D9737
mercurial/shelve.py
--- a/mercurial/shelve.py	Fri Jan 08 23:08:37 2021 -0800
+++ b/mercurial/shelve.py	Mon Jan 11 10:35:52 2021 -0800
@@ -617,14 +617,14 @@
 def listshelves(repo):
     """return all shelves in repo as list of (time, name)"""
     try:
-        names = repo.vfs.readdir(shelvedir)
+        names = repo.vfs.listdir(shelvedir)
     except OSError as err:
         if err.errno != errno.ENOENT:
             raise
         return []
     info = []
     seen = set()
-    for (filename, _type) in names:
+    for filename in names:
         name = filename.rsplit(b'.', 1)[0]
         if name in seen:
             continue