Optimized integer validation