From 003c62fee8d89cc4a06ca3193f72e086fdee41a2 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 12 Jan 2010 19:07:03 +0000 Subject: A null pointer can be safely passed to "delete", thus there is no need to check against the pointer being non-zero in advance. svn-id: r47272 --- engines/sci/graphics/text.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'engines/sci/graphics/text.cpp') diff --git a/engines/sci/graphics/text.cpp b/engines/sci/graphics/text.cpp index a65bd36339..c5a6c5ced2 100644 --- a/engines/sci/graphics/text.cpp +++ b/engines/sci/graphics/text.cpp @@ -41,8 +41,7 @@ Text::Text(ResourceManager *resMan, Gfx *gfx, Screen *screen) } Text::~Text() { - if (_font != NULL) - delete _font; + delete _font; } void Text::init() { @@ -59,8 +58,7 @@ GuiResourceId Text::GetFontId() { Font *Text::GetFont() { if ((_font == NULL) || (_font->getResourceId() != _gfx->_curPort->fontId)) { - if (_font != NULL) - delete _font; + delete _font; _font = new Font(_resMan, _gfx->_curPort->fontId); } @@ -69,8 +67,7 @@ Font *Text::GetFont() { void Text::SetFont(GuiResourceId fontId) { if ((_font == NULL) || (_font->getResourceId() != fontId)) { - if (_font != NULL) - delete _font; + delete _font; _font = new Font(_resMan, fontId); } -- cgit v1.2.3