QGraphicsView: Graph: don't compare pointers with op<

It's undefined behavior. Use std::less, which has
defined behavior.

Change-Id: I990d197590cf535c1cb5c055d0b6798e602446dc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
bb10
Marc Mutz 2016-01-16 20:24:03 +01:00
parent f48f8ba0bb
commit 1ee43b9b24
1 changed files with 3 additions and 2 deletions

View File

@ -56,6 +56,8 @@
#include <QtCore/QString>
#include <QtCore/QDebug>
#include <functional> // for std::less
#include <float.h>
QT_BEGIN_NAMESPACE
@ -213,9 +215,8 @@ public:
Vertex *from = it.from();
Vertex *to = it.to();
// do not return (from,to) *and* (to,from)
if (from < to) {
if (std::less<Vertex*>()(from, to))
conns.append(qMakePair(from, to));
}
}
return conns;
}