Faster int cast
Merge pull request #5596 from lucasmichot/4.2-int-cast

[4.2] Performances : Integer casting