[PATCH 3/3] pynfs: use list.append() instead += list in xdrgen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



list.append is MUCH faster even when dealing lists with few items

Signed-off-by: Weston Andros Adamson <dros@xxxxxxxxxx>
---
 xdr/xdrgen.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xdr/xdrgen.py b/xdr/xdrgen.py
index 963e01b..1f2a768 100755
--- a/xdr/xdrgen.py
+++ b/xdr/xdrgen.py
@@ -793,7 +793,7 @@ class Info(object):
             return "repr(self.%s)" % t.id
         indent2 = prefix + indent
         reprbody = ''.join(["%sif self.%s is not None:\n" \
-                            "%s%sout += ['%s=%%s' %% %s]\n" %
+                            "%s%sout.append('%s=%%s' %% %s)\n" %
                             (indent2, var.id, indent2, indent, var.id, special(var))
                             for var in varlist])
         return "%sdef __repr__(self):\n%sout = []\n" \
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux