@@ -97,19 +97,6 @@ function readSfixed64(bufferDecoder, start) {
9797 return Int64 . fromBits ( lowBits , highBits ) ;
9898}
9999
100- /**
101- * Reads a sint32 value from the binary bytes encoded as varint.
102- * @param {!BufferDecoder } bufferDecoder Binary format encoded bytes.
103- * @param {number } start Start of the data.
104- * @return {number }
105- * @package
106- */
107- function readSint32 ( bufferDecoder , start ) {
108- const bits = bufferDecoder . getUnsignedVarint32At ( start ) ;
109- // Truncate upper bits and convert from zig zag to signd int
110- return ( bits >>> 1 ) ^ - ( bits & 0x01 ) ;
111- }
112-
113100/**
114101 * Reads a sint64 value from the binary bytes encoded as varint.
115102 * @param {!BufferDecoder } bufferDecoder Binary format encoded bytes.
@@ -125,6 +112,17 @@ function readSint64(bufferDecoder, start) {
125112 return Int64 . fromBits ( decodedLowerBits , decodedUpperBits ) ;
126113}
127114
115+ /**
116+ * Reads a sint32 value from the binary bytes encoded as varint.
117+ * @param {!BufferDecoder } bufferDecoder Binary format encoded bytes.
118+ * @param {number } start Start of the data.
119+ * @return {number }
120+ * @package
121+ */
122+ function readSint32 ( bufferDecoder , start ) {
123+ return readSint64 ( bufferDecoder , start ) . getLowBits ( ) ;
124+ }
125+
128126/**
129127 * Read a subarray of bytes representing a length delimited field.
130128 * @param {!BufferDecoder } bufferDecoder Binary format encoded bytes.
0 commit comments