changeset 51372:0d414fb8336f

cleanup: remove unnecessary list constructor calls around list comprehensions
author Manuel Jacob <me@manueljacob.de>
date Fri, 02 Feb 2024 03:39:37 +0100
parents 508fd40dc86a
children cf1bee12ecdb
files hgext/githelp.py hgext/remotefilelog/__init__.py hgext/remotefilelog/remotefilelogserver.py tests/hghave.py
diffstat 4 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/githelp.py	Mon Feb 12 16:22:47 2024 +0100
+++ b/hgext/githelp.py	Fri Feb 02 03:39:37 2024 +0100
@@ -111,7 +111,7 @@
 
             ui.warn(_(b"ignoring unknown option %s\n") % flag)
 
-    args = list([convert(x) for x in args])
+    args = [convert(x) for x in args]
     opts = dict(
         [
             (k, convert(v)) if isinstance(v, bytes) else (k, v)
--- a/hgext/remotefilelog/__init__.py	Mon Feb 12 16:22:47 2024 +0100
+++ b/hgext/remotefilelog/__init__.py	Fri Feb 02 03:39:37 2024 +0100
@@ -583,7 +583,7 @@
 # prevent strip from stripping remotefilelogs
 def _collectbrokencsets(orig, repo, files, striprev):
     if isenabled(repo):
-        files = list([f for f in files if not repo.shallowmatch(f)])
+        files = [f for f in files if not repo.shallowmatch(f)]
     return orig(repo, files, striprev)
 
 
--- a/hgext/remotefilelog/remotefilelogserver.py	Mon Feb 12 16:22:47 2024 +0100
+++ b/hgext/remotefilelog/remotefilelogserver.py	Fri Feb 02 03:39:37 2024 +0100
@@ -61,7 +61,7 @@
                     repo.root, b'', None, includepattern, excludepattern
                 )
 
-            changedfiles = list([f for f in changedfiles if not m(f)])
+            changedfiles = [f for f in changedfiles if not m(f)]
         return orig(
             self, changedfiles, linknodes, commonrevs, source, *args, **kwargs
         )
--- a/tests/hghave.py	Mon Feb 12 16:22:47 2024 +0100
+++ b/tests/hghave.py	Fri Feb 02 03:39:37 2024 +0100
@@ -355,9 +355,7 @@
     return _hgversion
 
 
-@checkvers(
-    "hg", "Mercurial >= %s", list([(1.0 * x) / 10 for x in range(9, 99)])
-)
+@checkvers("hg", "Mercurial >= %s", [(1.0 * x) / 10 for x in range(9, 99)])
 def has_hg_range(v):
     major, minor = v.split('.')[0:2]
     return gethgversion() >= (int(major), int(minor))