Core: Add hashing support to Array data structure
Implements hashing with the same implementation as the `Vector` data structure. Hashing requested in PR review of #145531. Pull Request: https://projects.blender.org/blender/blender/pulls/145689
This commit is contained in:
committed by
Hans Goudey
parent
923b5f88ba
commit
6564f33eb3
@@ -355,6 +355,16 @@ class Array {
|
||||
return IndexRange(size_);
|
||||
}
|
||||
|
||||
uint64_t hash() const
|
||||
{
|
||||
return this->as_span().hash();
|
||||
}
|
||||
|
||||
static uint64_t hash_as(const Span<T> values)
|
||||
{
|
||||
return values.hash();
|
||||
}
|
||||
|
||||
friend bool operator==(const Array &a, const Array &b)
|
||||
{
|
||||
return a.as_span() == b.as_span();
|
||||
|
||||
Reference in New Issue
Block a user