diff options
author | Evan Martin <martine@danga.com> | 2012-04-05 00:26:50 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-04-05 00:26:50 (GMT) |
commit | f355f64f649a38cb7fec697d58c0f4b79a577ed7 (patch) | |
tree | baeed2988d82f67397bc4551434cb805fd7025c6 | |
parent | 10dd40066e853a016b47b25e53c4ff489b7ebefb (diff) | |
download | Ninja-f355f64f649a38cb7fec697d58c0f4b79a577ed7.zip Ninja-f355f64f649a38cb7fec697d58c0f4b79a577ed7.tar.gz Ninja-f355f64f649a38cb7fec697d58c0f4b79a577ed7.tar.bz2 |
Make |log_| variable private to BuildLog.
This fix the TODO in build_log.h file.
Signed-off-by: Thiago Farina <tfarina@chromium.org>
-rw-r--r-- | src/build_log.h | 5 | ||||
-rw-r--r-- | src/build_log_test.cc | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/build_log.h b/src/build_log.h index 040609d..da8e726 100644 --- a/src/build_log.h +++ b/src/build_log.h @@ -71,10 +71,11 @@ struct BuildLog { /// Rewrite the known log entries, throwing away old data. bool Recompact(const string& path, string* err); - // TODO: make these private. typedef ExternalStringHashMap<LogEntry*>::Type Log; + const Log& log() const { return log_; } + + private: Log log_; -private: FILE* log_file_; BuildConfig* config_; bool needs_recompaction_; diff --git a/src/build_log_test.cc b/src/build_log_test.cc index c6d6bc3..9b729c7 100644 --- a/src/build_log_test.cc +++ b/src/build_log_test.cc @@ -54,8 +54,8 @@ TEST_F(BuildLogTest, WriteRead) { EXPECT_TRUE(log2.Load(kTestFilename, &err)); ASSERT_EQ("", err); - ASSERT_EQ(2u, log1.log_.size()); - ASSERT_EQ(2u, log2.log_.size()); + ASSERT_EQ(2u, log1.log().size()); + ASSERT_EQ(2u, log2.log().size()); BuildLog::LogEntry* e1 = log1.LookupByOutput("out"); ASSERT_TRUE(e1); BuildLog::LogEntry* e2 = log2.LookupByOutput("out"); |