diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-12-28 12:46:12 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2017-12-28 17:30:25 +0100 |
commit | 6fa23f74f73d9baeb871670de0dcb6f5d3838cde (patch) | |
tree | 3826994867828093c48a295b8b9459e169a8e80c /qt-models/filtermodels.cpp | |
parent | 92a5e0644e1cb6c25c2c5e96b39d2368f0f1be5b (diff) | |
download | subsurface-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.cpp | 2 |
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; } |