void AggregatorMax::reduce(AqlValue const& cmpValue) { if (value.isEmpty() || AqlValue::Compare(trx, value, cmpValue, true) < 0) { value.destroy(); value = cmpValue.clone(); } }
void AggregatorMin::reduce(AqlValue const& cmpValue) { if (value.isEmpty() || (!cmpValue.isNull(true) && AqlValue::Compare(trx, value, cmpValue, true) > 0)) { // the value `null` itself will not be used in MIN() to compare lower than // e.g. value `false` value.destroy(); value = cmpValue.clone(); } }