1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:07:36 +00:00

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

View file

@ -143,7 +143,7 @@ private:
static V* node_to_value(TreeNode& node) 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));
} }
}; };