mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-05 05:17:46 -04:00
and fix a ton more minor performance issues
This commit is contained in:
@@ -674,7 +674,7 @@ void RemoteDebug::send(MESSAGE_TYPE type, const char* theName)
|
||||
|
||||
if (explicitMessageLength != 0)
|
||||
messageLength = explicitMessageLength;
|
||||
else if (strlen(ms_varArgs_buffer) > 0)
|
||||
else if (ms_varArgs_buffer[0] == '\0')
|
||||
{
|
||||
//only grab buffer sizes if needed
|
||||
messageLength = strlen(ms_varArgs_buffer)+1;
|
||||
@@ -688,7 +688,7 @@ void RemoteDebug::send(MESSAGE_TYPE type, const char* theName)
|
||||
|
||||
uint32 packetLength = static_cast<uint32>(messageTypeLength + channelNumberLength + messageLengthLength + static_cast<int>(messageLength));
|
||||
|
||||
if (strlen(ms_varArgs_buffer) > 0)
|
||||
if (ms_varArgs_buffer[0] == '\0')
|
||||
{
|
||||
//copy data into the packet
|
||||
memcpy(ms_buffer, &messageType, static_cast<uint32>(messageTypeLength));
|
||||
|
||||
@@ -106,8 +106,7 @@ RemoteDebug::Variable::Variable(const std::string& name, void *memLoc, VARIABLE_
|
||||
RemoteDebug::Variable::~Variable()
|
||||
{
|
||||
if(m_type == CSTRING)
|
||||
if (m_value.stringValue != NULL)
|
||||
delete m_value.stringValue;
|
||||
delete m_value.stringValue;
|
||||
|
||||
if(m_name)
|
||||
{
|
||||
@@ -157,8 +156,7 @@ void RemoteDebug::Variable::setValue(void *memLoc)
|
||||
break;
|
||||
|
||||
case CSTRING:
|
||||
if (m_value.stringValue)
|
||||
delete[] m_value.stringValue;
|
||||
delete[] m_value.stringValue;
|
||||
m_value.stringValue = new char[strlen(static_cast<char *>(memLoc))];
|
||||
strcpy(m_value.stringValue, const_cast<const char *>(static_cast<char *>(memLoc)));
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user