don't make a copy when hashing substrings
Merge pull request #6060 from stevengj/substring_hash

don't make a copy when hashing substrings