Explorar o código

use array.fill instead of for loop

Alexander Rose %!s(int64=4) %!d(string=hai) anos
pai
achega
24ae8dfda8
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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) {