Browse Source

use array.fill instead of for loop

Alexander Rose 4 years ago
parent
commit
24ae8dfda8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/mol-geo/util/marching-cubes/algorithm.ts

+ 1 - 1
src/mol-geo/util/marching-cubes/algorithm.ts

@@ -145,7 +145,7 @@ class MarchingCubesState {
         // clear either the top or bottom half of the buffer...
         const start = k % 2 === 0 ? 0 : 3 * this.nX * this.nY;
         const end = k % 2 === 0 ? 3 * this.nX * this.nY : this.verticesOnEdges.length;
-        for (let i = start; i < end; i++) this.verticesOnEdges[i] = 0;
+        this.verticesOnEdges.fill(0, start, end);
     }
 
     private interpolate(edgeNum: number) {