Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RID: Change comparison operators to use RID_Data id instead of address #59234

Merged
merged 1 commit into from
Mar 18, 2022
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
RID: Change comparison operators to use RID_Data id instead of address
This should helps making sorting more deterministic in physics and rendering.

The same change was done for 4.0 in 4f16397.
  • Loading branch information
akien-mga committed Mar 17, 2022
commit 797321fec45df71f1f7d4fcca4e9af30d11853b9
6 changes: 3 additions & 3 deletions core/rid.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ class RID {
return _data == p_rid._data;
}
_FORCE_INLINE_ bool operator<(const RID &p_rid) const {
return _data < p_rid._data;
return get_id() < p_rid.get_id();
}
_FORCE_INLINE_ bool operator<=(const RID &p_rid) const {
return _data <= p_rid._data;
return get_id() <= p_rid.get_id();
}
_FORCE_INLINE_ bool operator>(const RID &p_rid) const {
return _data > p_rid._data;
return get_id() > p_rid.get_id();
}
_FORCE_INLINE_ bool operator!=(const RID &p_rid) const {
return _data != p_rid._data;
Expand Down