mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +00:00
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:
parent
65e1589543
commit
4fbe77fb82
1 changed files with 5 additions and 0 deletions
|
@ -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]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue