summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaxim Kalaev <maximk@il.ibm.com>2012-10-12 06:57:23 (GMT)
committerMaxim Kalaev <maximk@il.ibm.com>2012-10-12 07:16:51 (GMT)
commit9e8bfe0365ccf78a524c0733a33b5bac2dc66f5a (patch)
treec0b88b028340cd9d960231227f6721ac2015b509 /src
parent17399ca4e5c0de7e64036c46cae616c86317e51f (diff)
downloadNinja-9e8bfe0365ccf78a524c0733a33b5bac2dc66f5a.zip
Ninja-9e8bfe0365ccf78a524c0733a33b5bac2dc66f5a.tar.gz
Ninja-9e8bfe0365ccf78a524c0733a33b5bac2dc66f5a.tar.bz2
build log: moving HashCommand() calculation out of targets loop
Diffstat (limited to 'src')
-rw-r--r--src/build_log.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/build_log.cc b/src/build_log.cc
index 33cbfc4..19e1c14 100644
--- a/src/build_log.cc
+++ b/src/build_log.cc
@@ -130,6 +130,7 @@ bool BuildLog::OpenForWrite(const string& path, string* err) {
void BuildLog::RecordCommand(Edge* edge, int start_time, int end_time,
TimeStamp restat_mtime) {
string command = edge->EvaluateCommand(true);
+ uint64_t command_hash = LogEntry::HashCommand(command);
for (vector<Node*>::iterator out = edge->outputs_.begin();
out != edge->outputs_.end(); ++out) {
const string& path = (*out)->path();
@@ -142,7 +143,7 @@ void BuildLog::RecordCommand(Edge* edge, int start_time, int end_time,
log_entry->output = path;
entries_.insert(Entries::value_type(log_entry->output, log_entry));
}
- log_entry->command_hash = LogEntry::HashCommand(command);
+ log_entry->command_hash = command_hash;
log_entry->start_time = start_time;
log_entry->end_time = end_time;
log_entry->restat_mtime = restat_mtime;