Only perform expensive check if the cast is unsafe
Merge pull request #3 from lamblin/take-op-c-code-clean

Only perform expensive check if the cast is unsafe