Don't create unnecessary closure in constructor
Merge pull request #2558 from fredj/optim

Don't create unnecessary closure in constructor