summaryrefslogtreecommitdiffstats
path: root/qt-models/filtermodels.cpp
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-12-28 12:46:12 +0100
committerGravatar Jan Mulder <jlmulder@xs4all.nl>2017-12-28 17:30:25 +0100
commit6fa23f74f73d9baeb871670de0dcb6f5d3838cde (patch)
tree3826994867828093c48a295b8b9459e169a8e80c /qt-models/filtermodels.cpp
parent92a5e0644e1cb6c25c2c5e96b39d2368f0f1be5b (diff)
downloadsubsurface-6fa23f74f73d9baeb871670de0dcb6f5d3838cde.tar.gz
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 <jlmulder@xs4all.nl>
Diffstat (limited to 'qt-models/filtermodels.cpp')
-rw-r--r--qt-models/filtermodels.cpp2
1 files changed, 1 insertions, 1 deletions
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;
}