Skip to content
Permalink
Browse files

Added lamda function to avoid using QVariant < > operators

  • Loading branch information
uclaros authored and nyalldawson committed Dec 28, 2020
1 parent 162c599 commit 0a5f4928649d476d48e36c5d9aee0c169a3a4a65
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/expression/qgsexpressionfunction.cpp
@@ -5345,13 +5345,13 @@ static QVariant fcnArrayLast( const QVariantList &values, const QgsExpressionCon
static QVariant fcnArrayMinimum( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent, const QgsExpressionNodeFunction * )
{
const QVariantList list = QgsExpressionUtils::getListValue( values.at( 0 ), parent );
return list.isEmpty() ? QVariant() : *std::min_element( list.constBegin(), list.constEnd() );
return list.isEmpty() ? QVariant() : *std::min_element( list.constBegin(), list.constEnd(), []( QVariant a, QVariant b ) -> bool { return ( qgsVariantLessThan( a, b ) ); } );
}

static QVariant fcnArrayMaximum( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent, const QgsExpressionNodeFunction * )
{
const QVariantList list = QgsExpressionUtils::getListValue( values.at( 0 ), parent );
return list.isEmpty() ? QVariant() : *std::max_element( list.constBegin(), list.constEnd() );
return list.isEmpty() ? QVariant() : *std::max_element( list.constBegin(), list.constEnd(), []( QVariant a, QVariant b ) -> bool { return ( qgsVariantLessThan( a, b ) ); } );
}

static QVariant convertToSameType( const QVariant &value, QVariant::Type type )

0 comments on commit 0a5f492

Please sign in to comment.
You can’t perform that action at this time.