Otimization in char to int conversation