소스 검색

use array.fill instead of for loop

Alexander Rose 4 년 전
부모
커밋
24ae8dfda8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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) {