From 1e4f5ba47c4c250697abe887785e63f27caf5e69 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 6 Mar 2008 19:31:14 +0000 Subject: [PATCH] Per Andre' advice: No need to check for pointer nullity for delete. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23515 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathHull.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index c626c86cc8..b7de48c89f 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -172,10 +172,8 @@ InsetMathHull::InsetMathHull(InsetMathHull const & other) InsetMathHull::~InsetMathHull() { - for (size_t i = 0; i < label_.size(); ++i) { - if (label_[i]) - delete label_[i]; - } + for (size_t i = 0; i < label_.size(); ++i) + delete label_[i]; } @@ -192,10 +190,8 @@ InsetMathHull & InsetMathHull::operator=(InsetMathHull const & other) InsetMathGrid::operator=(other); type_ = other.type_; nonum_ = other.nonum_; - for (size_t i = 0; i < label_.size(); ++i) { - if (label_[i]) - delete label_[i]; - } + for (size_t i = 0; i < label_.size(); ++i) + delete label_[i]; label_ = other.label_; for (size_t i = 0; i != label_.size(); ++i) { if (label_[i]) @@ -726,8 +722,7 @@ void InsetMathHull::delRow(row_type row) if (row == nrows() + 1) row--; nonum_.erase(nonum_.begin() + row); - if (label_[row]) - delete label_[row]; + delete label_[row]; label_.erase(label_.begin() + row); } -- 2.39.2