Skip to content

Commit

Permalink
use '= default' to define a trivial destructor
Browse files Browse the repository at this point in the history
Generated by clang-tidy modernize-use-equals-default
  • Loading branch information
chenshuo committed Oct 23, 2018
1 parent 000a7d7 commit a9a7274
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# Only run a few checks for now.
Checks: 'modernize-use-override'
Checks: 'modernize-use-equals-default'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
Expand Down
4 changes: 1 addition & 3 deletions muduo/base/Exception.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ Exception::Exception(const string& msg)
fillStackTrace();
}

Exception::~Exception() throw ()
{
}
Exception::~Exception() throw () = default;

const char* Exception::what() const throw()
{
Expand Down
4 changes: 1 addition & 3 deletions muduo/base/LogFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ LogFile::LogFile(const string& basename,
rollFile();
}

LogFile::~LogFile()
{
}
LogFile::~LogFile() = default;

void LogFile::append(const char* logline, int len)
{
Expand Down
2 changes: 1 addition & 1 deletion muduo/base/TimeZone.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TimeZone : public muduo::copyable
public:
explicit TimeZone(const char* zonefile);
TimeZone(int eastOfUtc, const char* tzname); // a fixed timezone
TimeZone() {} // an invalid timezone
TimeZone() = default; // an invalid timezone

// default copy ctor/assignment/dtor are Okay.

Expand Down
4 changes: 1 addition & 3 deletions muduo/net/Poller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ Poller::Poller(EventLoop* loop)
{
}

Poller::~Poller()
{
}
Poller::~Poller() = default;

bool Poller::hasChannel(Channel* channel) const
{
Expand Down
4 changes: 1 addition & 3 deletions muduo/net/poller/PollPoller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ PollPoller::PollPoller(EventLoop* loop)
{
}

PollPoller::~PollPoller()
{
}
PollPoller::~PollPoller() = default;

Timestamp PollPoller::poll(int timeoutMs, ChannelList* activeChannels)
{
Expand Down
2 changes: 1 addition & 1 deletion muduo/net/protobuf/ProtobufCodecLite.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class ProtobufCodecLite : noncopyable
{
}

virtual ~ProtobufCodecLite() { }
virtual ~ProtobufCodecLite() = default;

const string& tag() const { return tag_; }

Expand Down

0 comments on commit a9a7274

Please sign in to comment.