comparison mercurial/templateutil.py @ 37326:9cd88dd3bf64

templater: micro-optimize join() with empty separator
author Yuya Nishihara <yuya@tcha.org>
date Tue, 20 Mar 2018 23:16:28 +0900
parents 41a5d815d2c1
children ebf139cbd4a1
comparison
equal deleted inserted replaced
37325:41a5d815d2c1 37326:9cd88dd3bf64
556 """Join items with the separator; Returns generator of bytes""" 556 """Join items with the separator; Returns generator of bytes"""
557 first = True 557 first = True
558 for x in itemiter: 558 for x in itemiter:
559 if first: 559 if first:
560 first = False 560 first = False
561 else: 561 elif sep:
562 yield sep 562 yield sep
563 yield x 563 yield x