and fix a ton more minor performance issues

This commit is contained in:
DarthArgus
2014-10-27 22:39:57 -07:00
parent 14eaf713d0
commit c9c39d5713
97 changed files with 266 additions and 376 deletions
@@ -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;