Patchwork [05,of,22,V2-Series-D] hgweb: drop recursivity in _navseq

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 14, 2013, 8:35 p.m.
Message ID <7a93bd6e823ab85fe4f0.1358195737@yamac.lan>
Download mbox | patch
Permalink /patch/601/
State Accepted
Commit 28fa9443f7517e3fab47f34c8f6d78a92dfaa234
Headers show

Comments

Pierre-Yves David - Jan. 14, 2013, 8:35 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1357839866 -3600
# Node ID 7a93bd6e823ab85fe4f057937e4ca2b80e10744b
# Parent  d37dda282ef4a22805c8c2e22bb7e5be5cfabbda
hgweb: drop recursivity in _navseq

This is totally not needed.

Patch

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -27,15 +27,15 @@  def up(p):
 def _navseq(factor, limit=None):
     if limit:
         yield limit
         if limit >= 20 and limit <= 40:
             yield 50
-    else:
+        factor *= 10
+    while True:
         yield 1 * factor
         yield 3 * factor
-    for f in _navseq(factor * 10):
-        yield f
+        factor *= 10
 
 class revnav(object):
 
     def __init__(self, nodefunc):
         """Navigation generation object