From 5ab24a06d0870a45364180dbe4d946ef33bed9c4 Mon Sep 17 00:00:00 2001 From: komisan19 <18901496+komisan19@users.noreply.github.com> Date: Sun, 21 Apr 2024 23:31:50 +0900 Subject: [PATCH] refactor: add max func to maxTimestamp Signed-off-by: komisan19 <18901496+komisan19@users.noreply.github.com> --- .../remote/otlptranslator/prometheusremotewrite/helper.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/storage/remote/otlptranslator/prometheusremotewrite/helper.go b/storage/remote/otlptranslator/prometheusremotewrite/helper.go index 817cbaba7d..85019e272d 100644 --- a/storage/remote/otlptranslator/prometheusremotewrite/helper.go +++ b/storage/remote/otlptranslator/prometheusremotewrite/helper.go @@ -442,10 +442,8 @@ func mostRecentTimestampInMetric(metric pmetric.Metric) pcommon.Timestamp { } func maxTimestamp(a, b pcommon.Timestamp) pcommon.Timestamp { - if a > b { - return a - } - return b + resultTimestamp := max(a, b) + return resultTimestamp } // addSingleSummaryDataPoint converts pt to len(QuantileValues) + 2 samples.