Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG7e3ce2131882: py3: use pycompat.maplist instead of map
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
maxwidths = [] # [int] | maxwidths = [] # [int] | ||||
# calculate padding | # calculate padding | ||||
for f, sep, name, enc in self.funcmap: | for f, sep, name, enc in self.funcmap: | ||||
l = [enc(f(x)) for x in annotatedresult] | l = [enc(f(x)) for x in annotatedresult] | ||||
pieces.append(l) | pieces.append(l) | ||||
if name in ['node', 'date']: # node and date has fixed size | if name in ['node', 'date']: # node and date has fixed size | ||||
l = l[:1] | l = l[:1] | ||||
widths = map(encoding.colwidth, set(l)) | widths = pycompat.maplist(encoding.colwidth, set(l)) | ||||
maxwidth = (max(widths) if widths else 0) | maxwidth = (max(widths) if widths else 0) | ||||
maxwidths.append(maxwidth) | maxwidths.append(maxwidth) | ||||
# buffered output | # buffered output | ||||
result = '' | result = '' | ||||
for i in pycompat.xrange(len(annotatedresult)): | for i in pycompat.xrange(len(annotatedresult)): | ||||
for j, p in enumerate(pieces): | for j, p in enumerate(pieces): | ||||
sep = self.funcmap[j][1] | sep = self.funcmap[j][1] |