summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@colorado.edu>2021-08-12 13:01:02 -0600
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-08-13 17:39:33 +0430
commit077e78a8d72768679554927111de5dd00ac38dc7 (patch)
treeebc226942f44dcd406b3bbaa223a0a043aa26e2a
parent15f95220aea5e9cbe670d756b1eb0a9df73a8453 (diff)
downloadserenity-077e78a8d72768679554927111de5dd00ac38dc7.zip
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.
-rw-r--r--AK/IntrusiveRedBlackTree.h2
1 files changed, 1 insertions, 1 deletions
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<V*>(bit_cast<u8*>(&node) - bit_cast<u8*>(member));
}
};