Removed repeated type casting and function call overhead.
Merge pull request #1 from darknesto/master

Removing repeated type casting and function call overhead