Generator: little performance optimization