julia
8872f90b - Make arrays and ranges hash and compare equal (#16401)

Commit
8 years ago
Make arrays and ranges hash and compare equal (#16401) * Make vectors and ranges hash and compare equal When hashing AbstractVectors, first check whether their first elements are equal to a range, and hash them as a such if that's the case. This allows for O(1) hashing of (some) ranges consistent with AbstractArrays, which means they can now compare equal. Types which have a regular range step have to use the new TypeRangeStep trait to enable O(1) hashing rather than the O(N) AbstractArray fallback. Apply the new trait to date ranges which have a regular step. Add tests for the new behaviors.
Author
Committer
Parents
Loading