''.join() is still taking way too long. Turns out that doing a naieve str + other performs better. Who woulda thought.
authorBenjamin Smedberg <benjamin@smedbergs.us>
Thu, 26 Feb 2009 13:51:07 -0500
changeset 186 e48ab1f6d123
parent 185 cefacc0cd002
child 187 5d7346eb92cd
push id108
push userbsmedberg@mozilla.com
push dateThu, 26 Feb 2009 19:05:51 +0000
''.join() is still taking way too long. Turns out that doing a naieve str + other performs better. Who woulda thought.
pymake/data.py
--- a/pymake/data.py
+++ b/pymake/data.py
@@ -134,17 +134,21 @@ class Expansion(object):
         for i in self._elements:
             if isinstance(i, str):
                 yield i
             else:
                 for j in i.resolve(makefile, variables, setting):
                     yield j
                     
     def resolvestr(self, makefile, variables, setting=[]):
-        return ''.join(self.resolve(makefile, variables, setting))
+        s = ''
+        for i in self.resolve(makefile, variables, setting):
+            if i != '':
+                s += i
+        return s
 
     def resolvesplit(self, makefile, variables, setting=[]):
         return util.itersplit(self.resolve(makefile, variables, setting))
 
     def __len__(self):
         return len(self._elements)
 
     def __getitem__(self, key):