diff options
author | Brad King <brad.king@kitware.com> | 2019-02-12 16:00:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-04-18 12:21:44 (GMT) |
commit | c21f3f2a1d8cb0aea45804ffc788947c4096281b (patch) | |
tree | f2f2c3a4860477c29b589112bb73dd724b7d6889 /src | |
parent | 2375707bdfc83c79c94cac93a957de71c294737c (diff) | |
download | Ninja-c21f3f2a1d8cb0aea45804ffc788947c4096281b.zip Ninja-c21f3f2a1d8cb0aea45804ffc788947c4096281b.tar.gz Ninja-c21f3f2a1d8cb0aea45804ffc788947c4096281b.tar.bz2 |
clean: remove unnecessary Cleaner constructor variant
`Cleaner` provides two constructors that are the same except that one
constructs a "real" disk interface internally and the other takes a
caller-provided disk interface. A real disk interface is already
available at the only call site for the former constructor. Use it
directly and drop the unnecessary constructor variant.
Diffstat (limited to 'src')
-rw-r--r-- | src/clean.cc | 10 | ||||
-rw-r--r-- | src/clean.h | 4 | ||||
-rw-r--r-- | src/ninja.cc | 2 |
3 files changed, 1 insertions, 15 deletions
diff --git a/src/clean.cc b/src/clean.cc index ce6a575..caee8d3 100644 --- a/src/clean.cc +++ b/src/clean.cc @@ -22,16 +22,6 @@ #include "state.h" #include "util.h" -Cleaner::Cleaner(State* state, const BuildConfig& config) - : state_(state), - config_(config), - removed_(), - cleaned_(), - cleaned_files_count_(0), - disk_interface_(new RealDiskInterface), - status_(0) { -} - Cleaner::Cleaner(State* state, const BuildConfig& config, DiskInterface* disk_interface) diff --git a/src/clean.h b/src/clean.h index 19432ab..a007486 100644 --- a/src/clean.h +++ b/src/clean.h @@ -28,11 +28,7 @@ struct Rule; struct DiskInterface; struct Cleaner { - /// Build a cleaner object with a real disk interface. - Cleaner(State* state, const BuildConfig& config); - /// Build a cleaner object with the given @a disk_interface - /// (Useful for testing). Cleaner(State* state, const BuildConfig& config, DiskInterface* disk_interface); diff --git a/src/ninja.cc b/src/ninja.cc index b608426..8580e4f 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -651,7 +651,7 @@ int NinjaMain::ToolClean(const Options* options, int argc, char* argv[]) { return 1; } - Cleaner cleaner(&state_, config_); + Cleaner cleaner(&state_, config_, &disk_interface_); if (argc >= 1) { if (clean_rules) return cleaner.CleanRules(argc, argv); |