mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[unity] Use EnsureCapacity for predetermined list sizes.
This commit is contained in:
parent
62769c3e71
commit
d78b2fd024
@ -1469,13 +1469,13 @@ namespace Spine.Unity {
|
||||
this.hasActiveClipping = other.hasActiveClipping;
|
||||
this.rawVertexCount = other.rawVertexCount;
|
||||
this.attachments.Clear(false);
|
||||
this.attachments.GrowIfNeeded(other.attachments.Capacity);
|
||||
this.attachments.EnsureCapacity(other.attachments.Capacity);
|
||||
this.attachments.Count = other.attachments.Count;
|
||||
other.attachments.CopyTo(this.attachments.Items);
|
||||
#endif
|
||||
|
||||
this.submeshInstructions.Clear(false);
|
||||
this.submeshInstructions.GrowIfNeeded(other.submeshInstructions.Capacity);
|
||||
this.submeshInstructions.EnsureCapacity(other.submeshInstructions.Capacity);
|
||||
this.submeshInstructions.Count = other.submeshInstructions.Count;
|
||||
other.submeshInstructions.CopyTo(this.submeshInstructions.Items);
|
||||
}
|
||||
|
||||
@ -557,7 +557,8 @@ namespace Spine {
|
||||
|
||||
var drawOrder = skeleton.drawOrder;
|
||||
drawOrder.Clear(false);
|
||||
drawOrder.GrowIfNeeded(n);
|
||||
drawOrder.EnsureCapacity(n);
|
||||
drawOrder.Count = n;
|
||||
System.Array.Copy(slotsItems, drawOrder.Items, n);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user