perf: faster merge

This commit is contained in:
cha0s 2019-05-04 14:15:51 -05:00
parent 4b7bce35ab
commit d64fc4c1fb

View File

@ -18,7 +18,10 @@ export class DamagePacket extends EntityPacket {
} }
mergeWith(other) { mergeWith(other) {
this.data[0].damages.push(...other.data[0].damages); for (let i = 0; i < other.data[0].damages.length; i++) {
const damage = other.data[0].damages[i];
this.data[0].damages.push(damage);
}
} }
} }