summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/deps_log.cc5
-rw-r--r--src/deps_log.h3
2 files changed, 3 insertions, 5 deletions
diff --git a/src/deps_log.cc b/src/deps_log.cc
index 8dc6e69..c2587af 100644
--- a/src/deps_log.cc
+++ b/src/deps_log.cc
@@ -179,10 +179,7 @@ bool DepsLog::Load(const string& path, State* state, string* err) {
deps_data += 2;
int deps_count = (size / 4) - 2;
- Deps* deps = new Deps;
- deps->mtime = mtime;
- deps->node_count = deps_count;
- deps->nodes = new Node*[deps_count];
+ Deps* deps = new Deps(mtime, deps_count);
for (int i = 0; i < deps_count; ++i) {
assert(deps_data[i] < (int)nodes_.size());
assert(nodes_[deps_data[i]]);
diff --git a/src/deps_log.h b/src/deps_log.h
index 4b357a8..820997e 100644
--- a/src/deps_log.h
+++ b/src/deps_log.h
@@ -72,7 +72,8 @@ struct DepsLog {
// Reading (startup-time) interface.
struct Deps {
- Deps() : mtime(-1), node_count(0), nodes(NULL) {}
+ Deps(int mtime, int node_count)
+ : mtime(mtime), node_count(node_count), nodes(new Node*[node_count]) {}
~Deps() { delete [] nodes; }
int mtime;
int node_count;