Cachegrind says memset uses fewer instructions here
This commit is contained in:
@@ -447,9 +447,7 @@ inline void Node48::copyChildrenAndKeyFrom(const Node256 &other) {
|
||||
inline void Node256::copyChildrenAndKeyFrom(const Node48 &other) {
|
||||
memcpy((char *)this + kNodeCopyBegin, (char *)&other + kNodeCopyBegin,
|
||||
kNodeCopySize);
|
||||
for (int i = 0; i < 256; ++i) {
|
||||
children[i].child = nullptr;
|
||||
}
|
||||
memset(children, 0, sizeof(children));
|
||||
bitSet = other.bitSet;
|
||||
bitSet.forEachInRange(
|
||||
[&](int c) {
|
||||
@@ -464,9 +462,7 @@ inline void Node256::copyChildrenAndKeyFrom(const Node48 &other) {
|
||||
inline void Node256::copyChildrenAndKeyFrom(const Node256 &other) {
|
||||
memcpy((char *)this + kNodeCopyBegin, (char *)&other + kNodeCopyBegin,
|
||||
kNodeCopySize);
|
||||
for (int i = 0; i < 256; ++i) {
|
||||
children[i].child = nullptr;
|
||||
}
|
||||
memset(children, 0, sizeof(children));
|
||||
bitSet = other.bitSet;
|
||||
bitSet.forEachInRange(
|
||||
[&](int c) {
|
||||
|
Reference in New Issue
Block a user