Skip to content

Commit

Permalink
Optimize varint processing, add comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
wes-smith authored and dlongley committed Oct 16, 2024
1 parent 7a688b1 commit 03773ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ function _getPrefix({isLegacy, compressionMode, registryEntryId}) {
varintTagValue, varintByteValue
} = _getVarintStructure(registryEntryId);
if(varintByteValue) {
// define varintByteValue as first element in 2 element array
return [...varintTagValue, ...new Uint8Array([0x82]), ...varintByteValue];
// Define varintByteValue as first element in 2 element array
// `0x82` means "the following is a 2 element array"
return [...varintTagValue, 0x82, ...varintByteValue];
}
return varintTagValue;

Expand Down

0 comments on commit 03773ef

Please sign in to comment.