diff libinterp/corefcn/graphics.in.h @ 32733:1c40194c7b1f stable

eliminate useless "if (ptr)" checks protecting "delete ptr" statements. Affected files: graphics.in.h, ov-usr-fcn.cc, pt.h.
author John W. Eaton <jwe@octave.org>
date Thu, 11 Jan 2024 14:40:27 -0500
parents 2e484f9f1f18
children 6bfe60a31f73
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.in.h	Thu Jan 11 14:21:39 2024 -0500
+++ b/libinterp/corefcn/graphics.in.h	Thu Jan 11 14:40:27 2024 -0500
@@ -238,11 +238,7 @@
   {
     if (&s != this)
       {
-        if (m_rep)
-          {
-            delete m_rep;
-            m_rep = nullptr;
-          }
+        delete m_rep;
 
         m_rep = s.m_rep->clone ();
       }
@@ -252,11 +248,7 @@
 
   scaler& operator = (const std::string& s)
   {
-    if (m_rep)
-      {
-        delete m_rep;
-        m_rep = nullptr;
-      }
+    delete m_rep;
 
     if (s == "log")
       m_rep = new log_scaler ();