Skip to content

Commit 8bd0bcf

Browse files
authored
[GEN][ZH] Reduce cost of GameMessage::getCommandTypeAsString by 70% (#1259)
1 parent a81dba0 commit 8bd0bcf

File tree

16 files changed

+862
-865
lines changed

16 files changed

+862
-865
lines changed

Generals/Code/GameEngine/Include/Common/MessageStream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,8 @@ class GameMessage : public MemoryPoolObject
597597
Type getType( void ) const { return m_type; } ///< Return the message type
598598
UnsignedByte getArgumentCount( void ) const { return m_argCount; } ///< Return the number of arguments for this msg
599599

600-
AsciiString getCommandAsAsciiString( void ); ///< returns a string representation of the command type.
601-
static AsciiString getCommandTypeAsAsciiString(GameMessage::Type t);
600+
const char *getCommandAsString( void ) const; ///< returns a string representation of the command type.
601+
static const char *getCommandTypeAsString(GameMessage::Type t);
602602

603603
Int getPlayerIndex( void ) const { return m_playerIndex; } ///< Return the originating player
604604

Generals/Code/GameEngine/Include/GameNetwork/NetCommandMsg.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ class NetCommandMsg : public MemoryPoolObject
5656
void attach();
5757
void detach();
5858

59-
// For debugging purposes
60-
virtual AsciiString getContentsAsAsciiString(void) { return AsciiString::TheEmptyString; }
61-
6259
protected:
6360
UnsignedInt m_timestamp;
6461
UnsignedInt m_executionFrame;
@@ -86,9 +83,6 @@ class NetGameCommandMsg : public NetCommandMsg
8683
void addArgument(const GameMessageArgumentDataType type, GameMessageArgumentType arg);
8784
void setGameMessageType(GameMessage::Type type);
8885

89-
// For debugging purposes
90-
virtual AsciiString getContentsAsAsciiString(void);
91-
9286
protected:
9387
Int m_numArgs;
9488
Int m_argSize;

0 commit comments

Comments
 (0)