From 75613d7f9894260d47a801266413be9f73c1209b Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sun, 14 Oct 2018 20:43:18 +0200 Subject: [PATCH] PsppireSpreadSheetModel: Remove useless check and substitute a useful one. Found by cppcheck. --- src/ui/gui/psppire-spreadsheet-model.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ui/gui/psppire-spreadsheet-model.c b/src/ui/gui/psppire-spreadsheet-model.c index d426b55661..83a82d44fd 100644 --- a/src/ui/gui/psppire-spreadsheet-model.c +++ b/src/ui/gui/psppire-spreadsheet-model.c @@ -229,13 +229,10 @@ tree_model_get_iter (GtkTreeModel * model, GtkTreeIter * iter, static gboolean tree_model_iter_next (GtkTreeModel *model, GtkTreeIter *iter) { - PsppireSpreadsheetModel *spreadsheetModel = - PSPPIRE_SPREADSHEET_MODEL (model); + PsppireSpreadsheetModel *spreadsheetModel = PSPPIRE_SPREADSHEET_MODEL (model); + g_assert (iter); g_return_val_if_fail (iter->stamp == spreadsheetModel->stamp, FALSE); - if (iter == NULL) - return FALSE; - if ((intptr_t) iter->user_data >= spreadsheetModel->spreadsheet->n_sheets - 1) { iter->user_data = NULL; -- 2.30.2