Simplify.

This commit is contained in:
Jason Davies 2012-09-06 09:19:22 +01:00
parent 38e3a90a92
commit f83a02d145
1 changed files with 2 additions and 3 deletions

View File

@ -11,11 +11,10 @@
this.k = k;
var n = Math.ceil(m / 32);
if (typedArrays) {
var buffer = new ArrayBuffer(4 * n),
kbytes = 1 << Math.ceil(Math.log(Math.ceil(Math.log(m) / Math.LN2 / 8)) / Math.LN2),
var kbytes = 1 << Math.ceil(Math.log(Math.ceil(Math.log(m) / Math.LN2 / 8)) / Math.LN2),
array = kbytes === 1 ? Uint8Array : kbytes === 2 ? Uint16Array : Uint32Array,
kbuffer = new ArrayBuffer(kbytes * k);
this.buckets = new Uint32Array(buffer);
this.buckets = new Int32Array(n);
this._locations = new array(kbuffer);
} else {
var buckets = this.buckets = [],