libs/lmo: fix whitespace handling in string hashing, optimize code