Skip to content

Commit 033768f

Browse files
committed
Improved wording.
1 parent c712d37 commit 033768f

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

FastIntegerCompression.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'use strict';
1818

1919

20-
// you can provide an iterable
20+
// You can provide an iterable.
2121
function FastIntegerCompression() {
2222
}
2323

@@ -46,8 +46,8 @@ function zigzag_decode(val) {
4646
}
4747

4848

49-
// compute how many bytes an array of integers would use once compressed
50-
// input is expected to be an array of non-negative integers
49+
// Compute how many bytes an array of integers would use once compressed.
50+
// The input is expected to be an array of non-negative integers.
5151
FastIntegerCompression.computeCompressedSizeInBytes = function(input) {
5252
var c = input.length;
5353
var answer = 0;
@@ -58,8 +58,8 @@ FastIntegerCompression.computeCompressedSizeInBytes = function(input) {
5858
};
5959

6060

61-
// compute how many bytes an array of integers would use once compressed
62-
// input is expected to be an array of integers, some of them can be negative
61+
// Compute how many bytes an array of integers would use once compressed.
62+
// The input is expected to be an array of integers, some of them can be negative.
6363
FastIntegerCompression.computeCompressedSizeInBytesSigned = function(input) {
6464
var c = input.length;
6565
var answer = 0;
@@ -104,7 +104,8 @@ FastIntegerCompression.compress = function(input) {
104104
return buf;
105105
};
106106

107-
// from a compressed array of integers stored ArrayBuffer, compute the number of compressed integers by scanning the input
107+
// From a compressed array of integers stored ArrayBuffer,
108+
// compute the number of compressed integers by scanning the input.
108109
FastIntegerCompression.computeHowManyIntegers = function(input) {
109110
var view = new Int8Array(input);
110111
var c = view.length;
@@ -114,11 +115,11 @@ FastIntegerCompression.computeHowManyIntegers = function(input) {
114115
}
115116
return c - count;
116117
}
117-
// uncompress an array of integer from an ArrayBuffer, return the array
118-
// it is assumed that they were compressed using the compress function, the caller
118+
// Uncompress an array of integer from an ArrayBuffer, return the array.
119+
// It is assumed that they were compressed using the compress function, the caller
119120
// is responsible for ensuring that it is the case.
120121
FastIntegerCompression.uncompress = function(input) {
121-
var array = []
122+
var array = [] // The size of the output is not yet known.
122123
var inbyte = new Int8Array(input);
123124
var end = inbyte.length;
124125
var pos = 0;
@@ -190,11 +191,11 @@ FastIntegerCompression.compressSigned = function(input) {
190191
return buf;
191192
};
192193

193-
// uncompress an array of integer from an ArrayBuffer, return the array
194-
// it is assumed that they were compressed using the compressSigned function, the caller
194+
// Uncompress an array of integer from an ArrayBuffer, return the array.
195+
// It is assumed that they were compressed using the compressSigned function, the caller
195196
// is responsible for ensuring that it is the case.
196197
FastIntegerCompression.uncompressSigned = function(input) {
197-
var array = []
198+
var array = [] // The size of the output is not yet known.
198199
var inbyte = new Int8Array(input);
199200
var end = inbyte.length;
200201
var pos = 0;

0 commit comments

Comments
 (0)