perf: faster merge
This commit is contained in:
parent
4b7bce35ab
commit
d64fc4c1fb
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user