Skip to content

Commit

Permalink
修复一个ListComponent判断容量的手写错误
Browse files Browse the repository at this point in the history
  • Loading branch information
egametang committed Nov 21, 2023
1 parent 04eee36 commit 75700f4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions Unity/Assets/Scripts/Core/HashSetComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ public static HashSetComponent<T> Create()

public void Dispose()
{
if (this.Count > 64) // 超过64,让gc回收
{
return;
}
this.Clear();
ObjectPool.Instance.Recycle(this);
}
Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/Scripts/Core/ListComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static ListComponent<T> Create()

public void Dispose()
{
if (this.Count > 64) // 超过64,让gc回收
if (this.Capacity > 64) // 超过64,让gc回收
{
return;
}
Expand Down

0 comments on commit 75700f4

Please sign in to comment.