Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/templates/hashfuncs.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,13 @@ struct HashMapHasherDefault {
h = hash_murmur3_one_real(p_vec.w, h);
return hash_fmix32(h);
}
static _FORCE_INLINE_ uint32_t hash(const Color &p_vec) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_FORCE_INLINE_ is not appropriate here.
I assume you got there since you copied it from other functions' signatures, but it also wasn't appropriate there either, just nobody fixed this yet :)

Suggested change
static _FORCE_INLINE_ uint32_t hash(const Color &p_vec) {
static uint32_t hash(const Color &p_vec) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that every other method has it, I think it's better for code adding the missing one to be consistent.

If the _FORCE_INLINE_ is wrong in the other methods, it should be removed in a separate PR (and then this one can be removed too).

uint32_t h = hash_murmur3_one_float(p_vec.r);
h = hash_murmur3_one_float(p_vec.g, h);
h = hash_murmur3_one_float(p_vec.b, h);
h = hash_murmur3_one_float(p_vec.a, h);
return hash_fmix32(h);
}
static _FORCE_INLINE_ uint32_t hash(const Rect2i &p_rect) {
uint32_t h = hash_murmur3_one_32(uint32_t(p_rect.position.x));
h = hash_murmur3_one_32(uint32_t(p_rect.position.y), h);
Expand Down