I got betteer times virtually almost all scenarios using `return c <= '9' && '0' <= c;` There's almost nothing before '9', but there's a lot after '0', so it's better to test in this order. In particular, it makes quite the difference if the char turned out to be a unicode.