A micro optimization of h()

In most cases, the first argument of h() will be a string.
Merge pull request #3927 from chinpei215/master-h-opt

A micro optimization of h()