Very minor optimization for ACS str(i)cmp

- If the two strings compared both point to the same location in memory,
  then we know they are the same string without having to bother actually
  comparing their contents. Note that the opposite is not neccessarily
  true: If they point to two different locations, they could still match a
  case-sensitive comparison because there are still two ACS string tables:
  the one that belongs to the map's script and the one that belongs to
  everything else.
This commit is contained in:
Randy Heit 2016-05-01 16:49:35 -05:00
parent 65e1589543
commit 4fbe77fb82

View file

@ -5567,6 +5567,11 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
if (argCount >= 2)
{
const char *a, *b;
// If the string indicies are the same, then they are the same string.
if (args[0] == args[1])
{
return 0;
}
a = FBehavior::StaticLookupString(args[0]);
b = FBehavior::StaticLookupString(args[1]);