From 9e8bfe0365ccf78a524c0733a33b5bac2dc66f5a Mon Sep 17 00:00:00 2001 From: Maxim Kalaev Date: Fri, 12 Oct 2012 08:57:23 +0200 Subject: build log: moving HashCommand() calculation out of targets loop --- src/build_log.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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::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; -- cgit v0.12