소스 검색

Remove indexOf check due to performance overhead.

- Remove use of indexOf
- Drop instanceof in favor of Array.isArray
Markus Billharz 6 년 전
부모
커밋
927f1a8c36
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Materials/materialHelper.ts

+ 1 - 1
src/Materials/materialHelper.ts

@@ -578,7 +578,7 @@ export class MaterialHelper {
      */
     public static PrepareAttributesForInstances(attribs: string[], defines: any): void {
         // Check if we are handling a MaterialDefine or an Array containing the #define
-        if (defines["INSTANCES"] || (defines instanceof Array && defines.indexOf("#define INSTANCES") > -1)) {
+        if (defines["INSTANCES"] || Array.isArray(defines)) {
             attribs.push("world0");
             attribs.push("world1");
             attribs.push("world2");