Lutz Roeder 5 лет назад
Родитель
Сommit
6f88ae10f3
1 измененных файлов с 3 добавлено и 4 удалено
  1. 3 4
      source/barracuda.js

+ 3 - 4
source/barracuda.js

@@ -534,10 +534,9 @@ barracuda.BinaryReader = class {
     }
 
     int32s() {
-        const values = [];
-        const count = this.int32();
-        for (let i = 0; i < count; i++) {
-            values.push(this.int32());
+        const values = new Array(this.int32());
+        for (let i = 0; i < values.length; i++) {
+            values[i] = this.int32();
         }
         return values;
     }