Skip to content

Commit d2b2dfe

Browse files
committed
removed ShowTime logic from OneShotTimer
1 parent ecef159 commit d2b2dfe

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
@@ -270,7 +270,7 @@ int CppCheckExecutor::check(int argc, const char* const argv[])
270270

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

275275
settings.loadSummaries();
276276

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
@@ -130,11 +130,8 @@ static std::string durationToString(std::chrono::milliseconds duration)
130130
return (ellapsedTime + secondsStr + "s");
131131
}
132132

133-
OneShotTimer::OneShotTimer(std::string name, ShowTime showtime)
133+
OneShotTimer::OneShotTimer(std::string name)
134134
{
135-
if (showtime == ShowTime::NONE)
136-
return;
137-
138135
class MyResults : public TimerResultsIntf
139136
{
140137
private:

lib/timer.h

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

0 commit comments

Comments
 (0)