Skip to content

Commit 445ea21

Browse files
committed
removed ShowTime logic from OneShotTimer
1 parent fd857cf commit 445ea21

4 files changed

Lines changed: 4 additions & 7 deletions

File tree

cli/cppcheckexecutor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ int CppCheckExecutor::check(int argc, const char* const argv[])
269269

270270
std::unique_ptr<OneShotTimer> overallTimer;
271271
if (settings.showtime == ShowTime::SUMMARY || settings.showtime == ShowTime::TOP5_SUMMARY)
272-
overallTimer.reset(new OneShotTimer("Overall time", settings.showtime));
272+
overallTimer.reset(new OneShotTimer("Overall time"));
273273

274274
settings.loadSummaries();
275275

lib/cppcheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ unsigned int CppCheck::checkInternal(const FileWithDetails& file, const std::str
925925

926926
std::unique_ptr<OneShotTimer> checkTimeTimer;
927927
if (mSettings.showtime == ShowTime::FILE || mSettings.showtime == ShowTime::FILE_TOTAL || mSettings.showtime == ShowTime::TOP5_FILE)
928-
checkTimeTimer.reset(new OneShotTimer("Check time: " + file.spath(), mSettings.showtime));
928+
checkTimeTimer.reset(new OneShotTimer("Check time: " + file.spath()));
929929

930930
if (!mSettings.quiet) {
931931
std::string fixedpath = Path::toNativeSeparators(file.spath());

lib/timer.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,8 @@ static std::string durationToString(std::chrono::milliseconds duration)
132132
return (ellapsedTime + secondsStr + "s");
133133
}
134134

135-
OneShotTimer::OneShotTimer(std::string name, ShowTime showtime)
135+
OneShotTimer::OneShotTimer(std::string name)
136136
{
137-
if (showtime == ShowTime::NONE)
138-
return;
139-
140137
class MyResults : public TimerResultsIntf
141138
{
142139
private:

lib/timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class CPPCHECKLIB Timer {
105105
class CPPCHECKLIB OneShotTimer
106106
{
107107
public:
108-
OneShotTimer(std::string name, ShowTime showtime);
108+
OneShotTimer(std::string name);
109109
private:
110110
std::unique_ptr<TimerResultsIntf> mResults;
111111
std::unique_ptr<Timer> mTimer;

0 commit comments

Comments
 (0)