*/
bool QVariant::cmp(const QVariant &v) const
{
- if (d.type != v.d.type) {
+ QVariant v2 = v;
+ if (d.type != v2.d.type) {
if (qIsNumericType(d.type) && qIsNumericType(v.d.type)) {
if (qIsFloatingPoint(d.type) || qIsFloatingPoint(v.d.type))
return qFuzzyCompare(toReal(), v.toReal());
else
return toLongLong() == v.toLongLong();
}
- QVariant v2 = v;
- if (!v.canConvert(Type(d.type)) || !v2.convert(Type(d.type)))
+ if (!v2.canConvert(Type(d.type)) || !v2.convert(Type(d.type)))
return false;
}
- return handler->compare(&d, &v.d);
+ return handler->compare(&d, &v2.d);
}
/*! \internal