Commits

Yuya Nishihara committed 0c35de0

hglib: avoid creation of temporary list in buildcmdargs

It didn't contribute to readability.

  • Participants
  • Parent commits fa81c07

Comments (0)

Files changed (1)

File tortoisehg/util/hglib.py

         if isinstance(v, bool):
             if v:
                 fullargs.append(aname)
+        elif isinstance(v, list):
+            for e in v:
+                fullargs.append(aname)
+                fullargs.append(e)
         else:
-            for e in isinstance(v, basestring) and [v] or v:
-                fullargs += [aname, e]
+            fullargs.append(aname)
+            fullargs.append(v)
 
     return fullargs