Remove newBigramLinkedNodePos from ver4 format.

Bug: 11973488
Change-Id: I98045abaaf8566b1122fa5a531f8f48ad9562680
diff --git a/native/jni/src/suggest/policyimpl/dictionary/structure/pt_common/pt_node_params.h b/native/jni/src/suggest/policyimpl/dictionary/structure/pt_common/pt_node_params.h
index b5ef61b..e99bb21 100644
--- a/native/jni/src/suggest/policyimpl/dictionary/structure/pt_common/pt_node_params.h
+++ b/native/jni/src/suggest/policyimpl/dictionary/structure/pt_common/pt_node_params.h
@@ -57,14 +57,13 @@
     PtNodeParams(const int headPos, const PatriciaTrieReadingUtils::NodeFlags flags,
             const int parentPos, const int codePointCount, const int *const codePoints,
             const int terminalIdFieldPos, const int terminalId, const int probability,
-            const int childrenPosFieldPos, const int childrenPos, const int bigramLinkedNodePos,
-            const int siblingPos)
+            const int childrenPosFieldPos, const int childrenPos, const int siblingPos)
             : mHeadPos(headPos), mFlags(flags), mParentPos(parentPos),
               mCodePointCount(codePointCount), mCodePoints(),
               mTerminalIdFieldPos(terminalIdFieldPos), mTerminalId(terminalId),
               mProbabilityFieldPos(NOT_A_DICT_POS), mProbability(probability),
               mChildrenPosFieldPos(childrenPosFieldPos), mChildrenPos(childrenPos),
-              mBigramLinkedNodePos(bigramLinkedNodePos), mShortcutPos(terminalId),
+              mBigramLinkedNodePos(NOT_A_DICT_POS), mShortcutPos(terminalId),
               mBigramPos(terminalId), mSiblingPos(siblingPos) {
         memcpy(mCodePoints, codePoints, sizeof(int) * mCodePointCount);
     }
diff --git a/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_reader.cpp b/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_reader.cpp
index 9f7b34d..3926a93 100644
--- a/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_reader.cpp
+++ b/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_reader.cpp
@@ -26,7 +26,7 @@
 namespace latinime {
 
 const PtNodeParams Ver4PatriciaTrieNodeReader::fetchPtNodeInfoFromBufferAndProcessMovedPtNode(
-        const int ptNodePos, const int siblingNodePos, const int bigramLinkedNodePos) const {
+        const int ptNodePos, const int siblingNodePos) const {
     if (ptNodePos < 0 || ptNodePos >= mBuffer->getTailPosition()) {
         // Reading invalid position because of bug or broken dictionary.
         AKLOGE("Fetching PtNode info from invalid dictionary position: %d, dictionary size: %d",
@@ -73,12 +73,6 @@
     if (usesAdditionalBuffer && childrenPos != NOT_A_DICT_POS) {
         childrenPos += mBuffer->getOriginalBufferSize();
     }
-    int newBigramLinkedNodePos = bigramLinkedNodePos;
-    if (siblingNodePos == NOT_A_DICT_POS) {
-        if (DynamicPatriciaTrieReadingUtils::isMoved(flags)) {
-            newBigramLinkedNodePos = childrenPos;
-        }
-    }
     if (usesAdditionalBuffer) {
         pos += mBuffer->getOriginalBufferSize();
     }
@@ -87,12 +81,11 @@
     // Read destination node if the read node is a moved node.
     if (DynamicPatriciaTrieReadingUtils::isMoved(flags)) {
         // The destination position is stored at the same place as the parent position.
-        return fetchPtNodeInfoFromBufferAndProcessMovedPtNode(parentPos, newSiblingNodePos,
-                newBigramLinkedNodePos);
+        return fetchPtNodeInfoFromBufferAndProcessMovedPtNode(parentPos, newSiblingNodePos);
     } else {
         return PtNodeParams(headPos, flags, parentPos, codePonitCount, codePoints,
                 terminalIdFieldPos, terminalId, probability, childrenPosFieldPos, childrenPos,
-                newBigramLinkedNodePos, newSiblingNodePos);
+                newSiblingNodePos);
     }
 }
 
diff --git a/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_reader.h b/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_reader.h
index bdae0de..9d93245 100644
--- a/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_reader.h
+++ b/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_reader.h
@@ -42,7 +42,7 @@
 
     virtual const PtNodeParams fetchNodeInfoInBufferFromPtNodePos(const int ptNodePos) const {
         return fetchPtNodeInfoFromBufferAndProcessMovedPtNode(ptNodePos,
-                NOT_A_DICT_POS /* siblingNodePos */, NOT_A_DICT_POS /* bigramLinkedNodePos */);
+                NOT_A_DICT_POS /* siblingNodePos */);
     }
 
  private:
@@ -52,7 +52,7 @@
     const ProbabilityDictContent *const mProbabilityDictContent;
 
     const PtNodeParams fetchPtNodeInfoFromBufferAndProcessMovedPtNode(const int ptNodePos,
-            const int siblingNodePos, const int bigramLinkedNodePos) const;
+            const int siblingNodePos) const;
 };
 } // namespace latinime
 #endif /* LATINIME_VER4_PATRICIA_TRIE_NODE_READER_H */
diff --git a/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp b/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp
index 15a3b24..483c854 100644
--- a/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp
+++ b/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp
@@ -86,12 +86,6 @@
             mTrieBuffer, movedPos, toBeUpdatedPtNodeParams->getHeadPos(), &writingPos)) {
         return false;
     }
-    // Update bigram linked node position, which is stored in the children position field.
-    int childrenPosFieldPos = toBeUpdatedPtNodeParams->getChildrenPosFieldPos();
-    if (!DynamicPatriciaTrieWritingUtils::writeChildrenPositionAndAdvancePosition(
-            mTrieBuffer, bigramLinkedNodePos, &childrenPosFieldPos)) {
-        return false;
-    }
     if (toBeUpdatedPtNodeParams->hasChildren()) {
         // Update children's parent position.
         mReadingHelper.initWithPtNodeArrayPos(toBeUpdatedPtNodeParams->getChildrenPos());