summaryrefslogtreecommitdiffstats
path: root/qt-models/diveimportedmodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-12-09 19:10:55 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-12-17 07:37:32 -0800
commita6a5cf61e2f45eb54721c7ee2dbcc05afe8939f9 (patch)
tree9234c47ba08a4668070516fd8fe5841b4ed12772 /qt-models/diveimportedmodel.h
parent6febe22b6b0b03a99a2b1f08df8e75f43f5ba867 (diff)
downloadsubsurface-a6a5cf61e2f45eb54721c7ee2dbcc05afe8939f9.tar.gz
Cleanup: make DiveImportedModel::checkStates a std::vector
To not have to bother with memory-management. Moreover, the old code was in principle wrong, since it assumed that sizeof(bool) == 1. Of course, this is true for all supported platforms, but let's not depend on such implementation-defined behavior anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/diveimportedmodel.h')
-rw-r--r--qt-models/diveimportedmodel.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-models/diveimportedmodel.h b/qt-models/diveimportedmodel.h
index eeea0b82c..fc4d9147b 100644
--- a/qt-models/diveimportedmodel.h
+++ b/qt-models/diveimportedmodel.h
@@ -2,6 +2,7 @@
#define DIVEIMPORTEDMODEL_H
#include <QAbstractTableModel>
+#include <vector>
class DiveImportedModel : public QAbstractTableModel
{
@@ -31,7 +32,7 @@ slots:
private:
int firstIndex;
int lastIndex;
- bool *checkStates;
+ std::vector<char> checkStates; // char instead of bool to avoid silly pessimization of std::vector.
struct dive_table *diveTable;
};