# HG changeset patch # User Mads Kiilerich # Date 1565119597 -7200 # Node ID 62659d3824a072e52107a0c3e65f986bfa669d80 # Parent 708f1a55f17450e5a744b9faa93f78b4b374e783 celerylib: simplify over engineered repo walk diff -r 708f1a55f174 -r 62659d3824a0 kallithea/lib/celerylib/tasks.py --- a/kallithea/lib/celerylib/tasks.py Sun Jul 21 19:03:30 2019 +0200 +++ b/kallithea/lib/celerylib/tasks.py Tue Aug 06 21:26:37 2019 +0200 @@ -488,15 +488,13 @@ tip = repo.get_changeset() code_stats = {} - def aggregate(cs): - for f in cs[2]: - ext = f.extension.lower() - if ext in LANGUAGES_EXTENSIONS_MAP.keys() and not f.is_binary: + for _topnode, _dirnodes, filenodes in tip.walk('/'): + for filenode in filenodes: + ext = filenode.extension.lower() + if ext in LANGUAGES_EXTENSIONS_MAP.keys() and not filenode.is_binary: if ext in code_stats: code_stats[ext] += 1 else: code_stats[ext] = 1 - map(aggregate, tip.walk('/')) - return code_stats or {}