Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] gitview: revamped to use string.join, stripped a function def

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:52

"rae l" [off-list ref] writes:
Please give some comments.

On Sep 28, 2007 3:55 AM, Denis Cheng [off-list ref] wrote:
quoted
Signed-off-by: Denis Cheng <redacted>
Blast from the past ;-).
quoted
-def list_to_string(args, skip):
-       count = len(args)
-       i = skip
-       str_arg=" "
-       while (i < count ):
-               str_arg = str_arg + args[i]
-               str_arg = str_arg + " "
-               i = i+1
-
-       return str_arg
... 
                """Fill in different windows with info from the reposiroty"""
-               fp = os.popen("git rev-parse --sq --default HEAD " + list_to_string(args, 1))
+               fp = os.popen("git rev-parse --sq --default HEAD " + " ".join(args[1:]))
Obviously correct, loses extra SPs on both ends of the args
string, and reads more Pythonic.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help