Fix a bug: wrong parent position is written when moving.

Change-Id: I93d33ba9105eb85327108cca5706d8db3399de6a
main
Keisuke Kuroyanagi 2013-10-07 18:21:17 +09:00
parent a2821fde60
commit 802e6383ea
1 changed files with 2 additions and 1 deletions

View File

@ -240,7 +240,8 @@ bool DynamicPatriciaTrieWritingHelper::markNodeAsMovedAndSetPosition(
int parentOffsetFieldPos = nodeReader->getHeadPos()
+ DynamicPatriciaTrieWritingUtils::NODE_FLAG_FIELD_SIZE;
if (!DynamicPatriciaTrieWritingUtils::writeParentPosOffsetAndAdvancePosition(
mBuffer, movedPos, nodeReader->getHeadPos(), &parentOffsetFieldPos)) {
mBuffer, bigramLinkedNodePos, nodeReader->getHeadPos(),
&parentOffsetFieldPos)) {
// Parent offset cannot be written because of a bug or a broken dictionary; thus,
// we give up to update dictionary.
return false;