Skip to content

Commit

Permalink
fix: SOH issue (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikpil committed Jan 24, 2024
1 parent 0886b2c commit 7fef3a6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/DotRecast.Detour/DtNodePool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ 3. This notice may not be removed or altered from any source distribution.
*/

using System.Collections.Generic;
using DotRecast.Core.Collections;

namespace DotRecast.Detour
{
Expand All @@ -34,13 +35,12 @@ public DtNodePool()
public void Clear()
{
m_nodes.Clear();
m_map.Clear();
m_map.Values.ForEach(x => x.Clear());
}

public List<DtNode> FindNodes(long id)
{
var hasNode = m_map.TryGetValue(id, out var nodes);
;
if (nodes == null)
{
nodes = new List<DtNode>();
Expand All @@ -52,7 +52,6 @@ public List<DtNode> FindNodes(long id)
public DtNode FindNode(long id)
{
var hasNode = m_map.TryGetValue(id, out var nodes);
;
if (nodes != null && 0 != nodes.Count)
{
return nodes[0];
Expand Down

0 comments on commit 7fef3a6

Please sign in to comment.