[libsigcplusplus] trackable: Don't bother checking for null before using delete.



commit 7902df0362d9b6117973ebc97faa46a3e65158d8
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Apr 21 14:54:49 2017 +0200

    trackable: Don't bother checking for null before using delete.
    
    Because deleting null is allowed.
    Noticed by clang-tidy.

 sigc++/trackable.cc |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/sigc++/trackable.cc b/sigc++/trackable.cc
index 5bb4207..5020bc9 100644
--- a/sigc++/trackable.cc
+++ b/sigc++/trackable.cc
@@ -83,9 +83,7 @@ trackable::remove_destroy_notify_callback(notifiable* data) const
 void
 trackable::notify_callbacks()
 {
-  if (callback_list_)
-    delete callback_list_; // This invokes all of the callbacks.
-
+  delete callback_list_; // This invokes all of the callbacks.
   callback_list_ = nullptr;
 }
 


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