Optimize leaf? method
Merge pull request #27 from Napolskih/optimize-is-leaf

Optimize leaf? method