tables.py: eliminate use of enumerate
authorrgbecker
Fri, 01 Apr 2005 09:38:18 +0000
changeset 2474 5462fb8b792d
parent 2473 10d3b640b4f7
child 2475 24a8e6ffc36a
tables.py: eliminate use of enumerate
reportlab/platypus/tables.py
--- a/reportlab/platypus/tables.py	Thu Mar 31 15:35:20 2005 +0000
+++ b/reportlab/platypus/tables.py	Fri Apr 01 09:38:18 2005 +0000
@@ -667,12 +667,16 @@
         W = list(self._argW)
         width = 0
         elementWidth = self._elementWidth
-        for colNo, w in enumerate(W):
+        rowNos = xrange(self._nrows)
+        values = self._cellvalues
+        styles = self._cellStyles
+        for colNo in xrange(len(W)):
+            w = W[colNo]
             if w is None or w=='*' or _endswith(w,'%'):
                 final = 0
-                for rowNo in range(self._nrows):
-                    value = self._cellvalues[rowNo][colNo]
-                    style = self._cellStyles[rowNo][colNo]
+                for rowNo in rowNos:
+                    value = values[rowNo][colNo]
+                    style = styles[rowNo][colNo]
                     new = (elementWidth(value,style)+
                            style.leftPadding+style.rightPadding)
                     final = max(final, new)