Reuse strings in StlPlayer.
This commit is contained in:
@@ -75,7 +75,6 @@ public:
|
||||
|
||||
void parseTraceFile()
|
||||
{
|
||||
std::string line;
|
||||
unsigned parsedLines = 0;
|
||||
lineContents.clear();
|
||||
while (file && !file.eof() && parsedLines < 10000)
|
||||
@@ -94,12 +93,13 @@ public:
|
||||
// Trace files MUST provide timestamp, command and address for every
|
||||
// transaction. The data information depends on the storage mode
|
||||
// configuration.
|
||||
std::string time;
|
||||
std::string command;
|
||||
std::string address;
|
||||
std::string dataStr;
|
||||
time.clear();
|
||||
command.clear();
|
||||
address.clear();
|
||||
dataStr.clear();
|
||||
|
||||
std::istringstream iss(line);
|
||||
iss.clear();
|
||||
iss.str(line);
|
||||
|
||||
// Get the timestamp for the transaction.
|
||||
iss >> time;
|
||||
@@ -213,6 +213,14 @@ private:
|
||||
|
||||
std::vector<LineContent> lineContents;
|
||||
std::vector<LineContent>::const_iterator lineIterator;
|
||||
|
||||
std::string time;
|
||||
std::string command;
|
||||
std::string address;
|
||||
std::string dataStr;
|
||||
|
||||
std::string line;
|
||||
std::istringstream iss;
|
||||
};
|
||||
|
||||
#endif // STLPLAYER_H
|
||||
|
||||
Reference in New Issue
Block a user