Garbage Collector Alloc from String issue

Hi, From Looking at the Profiler, the following code seem to generate 56B of Garbage

It seems to come from String related stuff.

Can anyone tell me why and how should I solve this?

THX


protected bool CompareBaseState(string stateName)
	{
		AnimatorStateInfo currentBaseState = anim.GetCurrentAnimatorStateInfo((int)MOTIONLAYER.BASE);
		
		stateName = "Base." + stateName;
		
		if(currentBaseState.nameHash == Animator.StringToHash(stateName)) { return true; }
		return false;
	}

using System.Collections.Generic;

 ...

 Dictionary<string, string> baseNames = new Dictionary<string,string>();

protected bool CompareBaseState(string stateName)
{
   AnimatorStateInfo currentBaseState = anim.GetCurrentAnimatorStateInfo((int)MOTIONLAYER.BASE);
   if(!baseNames.ContainsKey(stateName))
        baseNames[stateName] = "Base." + stateName;
   stateName = baseNames[stateName];

   if(currentBaseState.nameHash == Animator.StringToHash(stateName)) { return true; }
   return false;
}