From 2e246ec6a4435a4a004d499c1683f88b2e61df92 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Sat, 16 Mar 2024 08:46:41 -0700 Subject: [PATCH] Cachegrind says this is fewer instructions --- ConflictSet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 561c352..be05a46 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -322,7 +322,8 @@ inline void Node3::copyChildrenAndKeyFrom(const Node0 &other) { inline void Node3::copyChildrenAndKeyFrom(const Node3 &other) { memcpy((char *)this + kNodeCopyBegin, (char *)&other + kNodeCopyBegin, kNodeCopySize); - memcpy(index, other.index, sizeof(*this) - sizeof(Node) + partialKeyLen); + memcpy(index, other.index, sizeof(*this) - sizeof(Node)); + memcpy(partialKey(), &other + 1, partialKeyLen); for (int i = 0; i < numChildren; ++i) { assert(children[i].child->parent == &other); children[i].child->parent = this;