Optimisations for hash functions and mapping. Short-circuit alignment if we have
an exact match.