Skip to content

Commit 659cfd7

Browse files
author
Daniel Wirtz
committed
dst reference in writeVarint64, fixes #2
1 parent 5ef5656 commit 659cfd7

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

ByteBuffer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,10 +1135,10 @@
11351135
var part0 = value.toInt() >>> 0,
11361136
part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
11371137
part2 = value.shiftRightUnsigned(56).toInt() >>> 0,
1138-
size = ByteBuffer.calculateVarint64(value),
1139-
dst = new Uint8Array(this.array);
1138+
size = ByteBuffer.calculateVarint64(value);
11401139

11411140
this.ensureCapacity(offset+size);
1141+
var dst = new Uint8Array(this.array);
11421142
switch (size) {
11431143
case 10: dst[offset+9] = ((part2 >>> 7) | 0x80);
11441144
case 9 : dst[offset+8] = ((part2 ) | 0x80);

ByteBuffer.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ByteBuffer.min.map

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

ByteBuffer.noexpose.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,10 +1065,10 @@
10651065
var part0 = value.toInt() >>> 0,
10661066
part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
10671067
part2 = value.shiftRightUnsigned(56).toInt() >>> 0,
1068-
size = ByteBuffer.calculateVarint64(value),
1069-
dst = new Uint8Array(this.array);
1068+
size = ByteBuffer.calculateVarint64(value);
10701069

10711070
this.ensureCapacity(offset+size);
1071+
var dst = new Uint8Array(this.array);
10721072
switch (size) {
10731073
case 10: dst[offset+9] = ((part2 >>> 7) | 0x80);
10741074
case 9 : dst[offset+8] = ((part2 ) | 0x80);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bytebuffer",
3-
"version": "1.3.2",
3+
"version": "1.3.3",
44
"author": "Daniel Wirtz <[email protected]>",
55
"description": "ByteBuffer.js: A Java-like, Netty-inspired ByteBuffer implementation using typed arrays.",
66
"main": "ByteBuffer.js",

src/ByteBuffer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,10 +1135,10 @@
11351135
var part0 = value.toInt() >>> 0,
11361136
part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
11371137
part2 = value.shiftRightUnsigned(56).toInt() >>> 0,
1138-
size = ByteBuffer.calculateVarint64(value),
1139-
dst = new Uint8Array(this.array);
1138+
size = ByteBuffer.calculateVarint64(value);
11401139

11411140
this.ensureCapacity(offset+size);
1141+
var dst = new Uint8Array(this.array);
11421142
switch (size) {
11431143
case 10: dst[offset+9] = ((part2 >>> 7) | 0x80);
11441144
case 9 : dst[offset+8] = ((part2 ) | 0x80);

0 commit comments

Comments
 (0)