[glom] Remove more unnecessary null checks before delete
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Remove more unnecessary null checks before delete
- Date: Thu, 16 Dec 2010 13:29:07 +0000 (UTC)
commit d687b82bf45e8461bac0d6bc996a2ed08058d6b7
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Dec 16 14:28:54 2010 +0100
Remove more unnecessary null checks before delete
glom/mode_data/box_data_calendar_related.cc | 3 +--
glom/mode_design/fields/dialog_fielddefinition.cc | 7 ++-----
2 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/glom/mode_data/box_data_calendar_related.cc b/glom/mode_data/box_data_calendar_related.cc
index 09fc4ec..0d31405 100644
--- a/glom/mode_data/box_data_calendar_related.cc
+++ b/glom/mode_data/box_data_calendar_related.cc
@@ -240,8 +240,7 @@ void Box_Data_Calendar_Related::clear_cached_database_values()
for(type_list_vectors::iterator iter = vec.begin(); iter != vec.end(); ++iter)
{
type_vector_values* pValues = *iter;
- if(pValues)
- delete pValues;
+ delete pValues;
}
}
diff --git a/glom/mode_design/fields/dialog_fielddefinition.cc b/glom/mode_design/fields/dialog_fielddefinition.cc
index 0cb4714..76c9ee6 100644
--- a/glom/mode_design/fields/dialog_fielddefinition.cc
+++ b/glom/mode_design/fields/dialog_fielddefinition.cc
@@ -146,11 +146,8 @@ void Dialog_FieldDefinition::set_field(const sharedptr<const Field>& field, cons
default_value = m_Field->get_default_value();
//Create an appropriate DataWidget for the default value:
- if(m_pDataWidget_DefaultValueSimple)
- {
- delete m_pDataWidget_DefaultValueSimple;
- m_pDataWidget_DefaultValueSimple = 0;
- }
+ delete m_pDataWidget_DefaultValueSimple;
+ m_pDataWidget_DefaultValueSimple = 0;
//We use a regular DataWidget for the default value, so we can reuse its functionality,
//but it's not a real field - hence the special title.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]