From 2e9a7df603e7715c4a69d522b3df60a8eb01f6c8 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Tue, 10 May 2022 15:31:01 +0200 Subject: [PATCH] use uint8 type encoding for relative-positions --- src/utils/RelativePosition.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/RelativePosition.js b/src/utils/RelativePosition.js index ea3e33e9..39f53ebc 100644 --- a/src/utils/RelativePosition.js +++ b/src/utils/RelativePosition.js @@ -196,7 +196,7 @@ export const createRelativePositionFromTypeIndex = (type, index, assoc = 0) => { export const writeRelativePosition = (encoder, rpos) => { const { type, tname, item, assoc } = rpos if (item !== null) { - encoding.writeVarUint(encoder, 0) + encoding.writeUint8(encoder, 0) writeID(encoder, item) } else if (tname !== null) { // case 2: found position at the end of the list and type is stored in y.share @@ -233,7 +233,7 @@ export const readRelativePosition = decoder => { let type = null let tname = null let itemID = null - switch (decoding.readVarUint(decoder)) { + switch (decoding.readUint8(decoder)) { case 0: // case 1: found position somewhere in the linked list itemID = readID(decoder)