[libsigcplusplus] slot_base: Destructor: No need for null check before delete.



commit cacfd54d7ea83c9be65425cfc56bdfa8df46d270
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Jul 21 08:17:29 2017 +0200

    slot_base: Destructor: No need for null check before delete.
    
    Found by clang-tidy.

 sigc++/functors/slot_base.cc |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/sigc++/functors/slot_base.cc b/sigc++/functors/slot_base.cc
index 1281fb9..4c521a8 100644
--- a/sigc++/functors/slot_base.cc
+++ b/sigc++/functors/slot_base.cc
@@ -137,8 +137,7 @@ slot_base::slot_base(slot_base&& src) : rep_(nullptr), blocked_(src.blocked_)
 
 slot_base::~slot_base()
 {
-  if (rep_)
-    delete rep_;
+  delete rep_;
 }
 
 slot_base::operator bool() const noexcept


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]