ruiu added a comment. I didn't actually try to see the assembly output for this file, but decent compilers are smart enough to figure out that the lambda can be inlined, so I don't think this change doesn't improve performance. https://reviews.llvm.org/D43435