Skip to content

Commit

Permalink
Optimize map tags search for jump count
Browse files Browse the repository at this point in the history
  • Loading branch information
peterekepeter committed Jul 15, 2023
1 parent 3aee7fa commit 083ea27
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions MVES/Classes/MV_MapTags.uc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ function AddMapTags(string name, string tags)
{
// add to existing
MapTags[index] = MapTags[index]$tags$":";
Log("added to existing "$MapTags[index]);
return;
}
if (Count + 1 >= MaxCount)
Expand All @@ -86,18 +85,23 @@ function private string FindTags(string name)
return NoTags;
}


function private int FindIndex(string name)
{
local int i;
for (i = 0; i < Count; i += 1)
i = -1;

do
{
if (MapName[i] ~= name)
{
return i;
}
i += 1;
}
return -1;
until (MapName[i] ~= name || i >= Count);

if (i >= Count)
{
return -1;
}

return i;
}

function private AcceptNewQueryTags(string newQueryTags)
Expand All @@ -116,6 +120,6 @@ function private AcceptNewQueryTags(string newQueryTags)
continue;
}
queryTagSplit[queryTagSplitCount] = ":"$newTag$":";
queryTagSplitCount += 1;
queryTagSplitCount += 1;
}
}

0 comments on commit 083ea27

Please sign in to comment.