Skip to content

Commit

Permalink
fix(vectors): update field names in declareIndex()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Dec 24, 2018
1 parent 5620483 commit aa5ad97
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/vectors3/src/internal/accessors.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export const declareIndex = (
proto: any,
id: string,
i: number,
idx: number,
strided = true,
defNumeric = true
) => {
const get = strided ?
function () { return this.buf[this.i + i * this.s]; } :
function () { return this.buf[this.i + i]; };
function () { return this.buf[this.offset + idx * this.stride]; } :
function () { return this.buf[this.offset + idx]; };
const set = strided ?
function (n: number) { this.buf[this.i + i * this.s] = n; } :
function (n: number) { this.buf[this.i + i] = n; };
function (n: number) { this.buf[this.offset + idx * this.stride] = n; } :
function (n: number) { this.buf[this.offset + idx] = n; };

defNumeric && Object.defineProperty(proto, i, {
defNumeric && Object.defineProperty(proto, idx, {
get,
set,
enumerable: true,
Expand Down

0 comments on commit aa5ad97

Please sign in to comment.