optimize conditional statement
Merge pull request #7 from tychio/master

optimize conditional statement