From 6fa23f74f73d9baeb871670de0dcb6f5d3838cde Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Thu, 28 Dec 2017 12:46:12 +0100 Subject: [PATCH] cleanup: Argument cannot be negative CID 208296. IndexOf can return -1 when not found, which will not happen in this context, so just to silence Coverity. Signed-off-by: Jan Mulder --- qt-models/filtermodels.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index 925931480..f0178d3e1 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -222,7 +222,7 @@ bool TagFilterModel::doFilter(dive *d, QModelIndex &index0, QAbstractItemModel * while (head) { QString tagName(head->tag->name); int index = tagList.indexOf(tagName); - if (checkState[index]) + if (index >= 0 && checkState[index]) return !negate; head = head->next; }