Browse Source

Remove indexOf check due to performance overhead.

- Remove use of indexOf
- Drop instanceof in favor of Array.isArray
Markus Billharz 6 years ago
parent
commit
927f1a8c36
1 changed files with 1 additions and 1 deletions
  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");