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.
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 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 @@
return 1;
}
- Cleaner cleaner(&state_, config_);
+ Cleaner cleaner(&state_, config_, &disk_interface_);
if (argc >= 1) {
if (clean_rules)
return cleaner.CleanRules(argc, argv);