summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-02-05 21:47:39 +0100
committerJan Holesovsky <kendy@suse.cz>2013-02-05 21:47:39 +0100
commit67e88e4d23dce884d69c309c9babd0c1c6b3884a (patch)
tree3714ef10878d0b828e4a87732af9d3adc0a662fc
parent971cd290e50ed411e699a97c06ebb5407a7e27f2 (diff)
Dense B+ tree: Move m_pNext handling to a more suitable place.
Change-Id: I0fcf63c7c3559b0ee61cfb0a84d79e90399cf857
-rw-r--r--sw/inc/densebplustree.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/sw/inc/densebplustree.cxx b/sw/inc/densebplustree.cxx
index 68af75d54ccf..bb00a7a1684c 100644
--- a/sw/inc/densebplustree.cxx
+++ b/sw/inc/densebplustree.cxx
@@ -169,14 +169,14 @@ struct DBPTreeNode
m_pValues[ i - nHowMuchKeep ] = pNode->m_pValues[ i ];
offset = nHowMuchKeep;
-
- m_pNext = pNode->m_pNext;
- pNode->m_pNext = this;
}
m_nUsed = pNode->m_nUsed - nHowMuchKeep;
pNode->m_nUsed = nHowMuchKeep;
+ m_pNext = pNode->m_pNext;
+ pNode->m_pNext = this;
+
return offset;
}
};
@@ -268,11 +268,12 @@ void DenseBPlusTree< Key, Value >::Remove( Key nPos, Key nNumber )
// update indexes
shiftNodes( pParents, nParentsLength, aAfter.nIndex - nNumber );
+
+ // FIXME we have to create a function that walks up the parents to do
+ // this right even in the case nIndex == m_nUsed
if ( pParents[ nParentsLength - 1 ].nIndex < pParents[ nParentsLength - 1 ].pNode->m_nUsed - 1 )
++pParents[ nParentsLength - 1 ].nIndex;
shiftNodes( pParents, nParentsLength, -aAfter.nIndex );
-
- // FIXME now make sure every node contains at least sMinFill data
}
m_nCount -= nNumber;
@@ -507,6 +508,4 @@ void DenseBPlusTree< Key, Value >::removeBetween( const NodeWithIndex pFrom[], c
}
}
-// method name: balanceOrMerge()
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */