Store contraints in a hash structure instead of a map

Our key type here is a vector of fields and vectors aren't less than
comparable by default (and I have no idea how to implement a sane
operator<() for them). But because maps require less than comparability,
change the map to a hash which only requires an operator==() which a
vector should have by default.

No idea how this ever worked with a map?!

See issue #854.
This commit is contained in:
Martin Kleusberg
2016-11-04 18:02:59 +01:00
parent 60e4cb758e
commit f3dcf5a0c8
+2 -2
View File
@@ -9,7 +9,7 @@
#include <QVector>
#include <QStringList>
#include <QPair>
#include <QMultiMap>
#include <QMultiHash>
namespace sqlb {
@@ -155,7 +155,7 @@ private:
bool m_unique;
};
typedef QMultiMap<FieldVector, ConstraintPtr> ConstraintMap;
typedef QMultiHash<FieldVector, ConstraintPtr> ConstraintMap;
class Table
{