From 077e78a8d72768679554927111de5dd00ac38dc7 Mon Sep 17 00:00:00 2001 From: Lenny Maiorani Date: Thu, 12 Aug 2021 13:01:02 -0600 Subject: 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. --- AK/IntrusiveRedBlackTree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/IntrusiveRedBlackTree.h b/AK/IntrusiveRedBlackTree.h index 5791760801..eb4bfaacac 100644 --- a/AK/IntrusiveRedBlackTree.h +++ b/AK/IntrusiveRedBlackTree.h @@ -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(bit_cast(&node) - bit_cast(member)); } }; -- cgit v1.2.3