Skip to content

Commit

Permalink
refactor(vectors): Vec3/4 toString() impls
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Sep 10, 2018
1 parent ae261ab commit f4cc0dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/vectors/src/vec3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,9 @@ export class Vec3 implements
}

toString() {
return `[${this.buf[this.i]}, ${this.buf[this.i + this.s]}, ${this.buf[this.i + 2 * this.s]}]`;
const i = this.i;
const s = this.s;
return `[${this.buf[i]}, ${this.buf[i + s]}, ${this.buf[i + 2 * s]}]`;
}

toJSON() {
Expand Down
4 changes: 3 additions & 1 deletion packages/vectors/src/vec4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,9 @@ export class Vec4 implements
}

toString() {
return `[${this.buf[this.i]}, ${this.buf[this.i + this.s]}, ${this.buf[this.i + 2 * this.s]}, ${this.buf[this.i + 3 * this.s]}]`;
const i = this.i;
const s = this.s;
return `[${this.buf[i]}, ${this.buf[i + s]}, ${this.buf[i + 2 * s]}, ${this.buf[i + 3 * s]}]`;
}

toJSON() {
Expand Down

0 comments on commit f4cc0dd

Please sign in to comment.