From: John Darrington Date: Sun, 14 Oct 2018 18:43:18 +0000 (+0200) Subject: PsppireSpreadSheetModel: Remove useless check and substitute a useful one. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75613d7f9894260d47a801266413be9f73c1209b;p=pspp PsppireSpreadSheetModel: Remove useless check and substitute a useful one. Found by cppcheck. --- 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;