mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-27 14:17:59 +03:00
Less memory usage in CScriptConCommand::CommandCompletionCallback
This commit is contained in:
parent
c25053d1d2
commit
6579e94305
@ -2290,9 +2290,18 @@ public:
|
||||
{
|
||||
if ( val.m_type == FIELD_CSTRING )
|
||||
{
|
||||
CUtlString s = val.m_pszString;
|
||||
//s.SetLength( COMMAND_COMPLETION_ITEM_LENGTH - 1 );
|
||||
commands.AddToTail( s );
|
||||
CUtlString &s = commands.Element( commands.AddToTail() );
|
||||
int len = V_strlen( val.m_pszString );
|
||||
|
||||
if ( len <= COMMAND_COMPLETION_ITEM_LENGTH - 1 )
|
||||
{
|
||||
s.Set( val.m_pszString );
|
||||
}
|
||||
else
|
||||
{
|
||||
s.SetDirect( val.m_pszString, COMMAND_COMPLETION_ITEM_LENGTH - 1 );
|
||||
}
|
||||
|
||||
++count;
|
||||
}
|
||||
g_pScriptVM->ReleaseValue(val);
|
||||
|
Loading…
x
Reference in New Issue
Block a user