Commits

Marcin Kuzminski  committed 54fc83f

Removed all string concat for exchange of ''.join()

  • Participants
  • Parent commits 5ae5aa6
  • Branches beta

Comments (0)

Files changed (2)

File rhodecode/controllers/feed.py

         self.feed_nr = 10
 
     def __changes(self, cs):
-        changes = ''
+        changes = []
 
         a = [safe_unicode(n.path) for n in cs.added]
         if a:
-            changes += '\nA ' + '\nA '.join(a)
+            changes.append('\nA ' + '\nA '.join(a))
 
         m = [safe_unicode(n.path) for n in cs.changed]
         if m:
-            changes += '\nM ' + '\nM '.join(m)
+            changes.append('\nM ' + '\nM '.join(m))
 
         d = [safe_unicode(n.path) for n in cs.removed]
         if d:
-            changes += '\nD ' + '\nD '.join(d)
+            changes.append('\nD ' + '\nD '.join(d))
 
-        changes += '</pre>'
+        changes.append('</pre>')
 
-        return changes
+        return ''.join(changes)
 
     def atom(self, repo_name):
         """Produce an atom-1.0 feed via feedgenerator module"""
                          description=self.description % repo_name,
                          language=self.language,
                          ttl=self.ttl)
-
+        desc_msg = []
         for cs in reversed(list(c.rhodecode_repo[-self.feed_nr:])):
-            desc = '%s - %s<br/><pre>' % (cs.author, cs.date)
-            desc += self.__changes(cs)
+            desc_msg.append('%s - %s<br/><pre>' % (cs.author, cs.date))
+            desc_msg.append(self.__changes(cs))
 
             feed.add_item(title=cs.message,
                           link=url('changeset_home', repo_name=repo_name,
                                    revision=cs.raw_id, qualified=True),
                           author_name=cs.author,
-                          description=desc)
+                          description=''.join(desc_msg))
 
         response.content_type = feed.mime_type
         return feed.writeString('utf-8')
                          description=self.description % repo_name,
                          language=self.language,
                          ttl=self.ttl)
-
+        desc_msg = []
         for cs in reversed(list(c.rhodecode_repo[-self.feed_nr:])):
-            desc = '%s - %s<br/><pre>' % (cs.author, cs.date)
-            desc += self.__changes(cs)
+            desc_msg.append('%s - %s<br/><pre>' % (cs.author, cs.date))
+            desc_msg.append(self.__changes(cs))
 
             feed.add_item(title=cs.message,
                           link=url('changeset_home', repo_name=repo_name,
                                    revision=cs.raw_id, qualified=True),
                           author_name=cs.author,
-                          description=desc,
+                          description=''.join(desc_msg),
                          )
 
         response.content_type = feed.mime_type

File rhodecode/lib/helpers.py

                                       invalidation_list=[])
 
         message = lambda rev: get_changeset_safe(repo, rev).message
-
-        cs_links = " " + ', '.join ([link_to(rev,
+        cs_links = []
+        cs_links.append(" " + ', '.join ([link_to(rev,
                 url('changeset_home',
                 repo_name=repo_name,
                 revision=rev), title=tooltip(message(rev)),
-                class_='tooltip') for rev in revs[:revs_limit] ])
+                class_='tooltip') for rev in revs[:revs_limit] ]))
 
         compare_view = (' <div class="compare_view tooltip" title="%s">'
                         '<a href="%s">%s</a> '
             '<a class="show_more" id="_%s" href="#more">%s</a> '
             '%s</span>')
             if not feed:
-                cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \
+                cs_links.append(html_tmpl % (_('and'), uniq_id, _('%s more') \
                                         % (len(revs) - revs_limit),
-                                        _('revisions'))
+                                        _('revisions')))
 
             if not feed:
                 html_tmpl = '<span id="%s" style="display:none"> %s </span>'
             else:
                 html_tmpl = '<span id="%s"> %s </span>'
 
-            cs_links += html_tmpl % (uniq_id, ', '.join([link_to(rev,
+            cs_links.append(html_tmpl % (uniq_id, ', '.join([link_to(rev,
                 url('changeset_home',
                 repo_name=repo_name, revision=rev),
                 title=message(rev), class_='tooltip')
-                for rev in revs[revs_limit:revs_top_limit]]))
+                for rev in revs[revs_limit:revs_top_limit]])))
         if len(revs) > 1:
-            cs_links += compare_view
-        return cs_links
+            cs_links.append(compare_view)
+        return ''.join(cs_links)
 
     def get_fork_name():
         repo_name = action_params