IntrusiveRedBlackTree: Remove redundant subtraction of 0

Problem:
- ToT clang will not build due to casting `nullptr` to `u8*`. This is
  redundant because it casts to get a `0` then subtracts it.

Solution:
- Remove it since subtracting `0` doesn't do anything.
This commit is contained in:
Lenny Maiorani 2021-08-12 13:01:02 -06:00 committed by Ali Mohammad Pur
parent 15f95220ae
commit 077e78a8d7
Notes: sideshowbarker 2024-07-18 07:02:07 +09:00

View File

@ -143,7 +143,7 @@ private:
static V* node_to_value(TreeNode& node)
{
return (V*)((u8*)&node - ((u8*)&(((V*)nullptr)->*member) - (u8*)nullptr));
return bit_cast<V*>(bit_cast<u8*>(&node) - bit_cast<u8*>(member));
}
};