From 19eeebb66d9fef6bd3dd621c0a1485ece648ef45 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 18 Jan 2022 10:41:59 -0500 Subject: [PATCH] perf_hooks: remove useless calls in Histogram Coverity reported some calls that had no effect, remove them Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/41579 Reviewed-By: Yash Ladha Reviewed-By: Darshan Sen Reviewed-By: Richard Lau --- src/histogram.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/histogram.cc b/src/histogram.cc index 87641a4a3691c7..63fa52a57df157 100644 --- a/src/histogram.cc +++ b/src/histogram.cc @@ -159,10 +159,10 @@ void HistogramBase::GetPercentiles(const FunctionCallbackInfo& args) { CHECK(args[0]->IsMap()); Local map = args[0].As(); (*histogram)->Percentiles([map, env](double key, int64_t value) { - map->Set( - env->context(), - Number::New(env->isolate(), key), - Number::New(env->isolate(), static_cast(value))).IsEmpty(); + USE(map->Set( + env->context(), + Number::New(env->isolate(), key), + Number::New(env->isolate(), static_cast(value)))); }); } @@ -174,10 +174,10 @@ void HistogramBase::GetPercentilesBigInt( CHECK(args[0]->IsMap()); Local map = args[0].As(); (*histogram)->Percentiles([map, env](double key, int64_t value) { - map->Set( - env->context(), - Number::New(env->isolate(), key), - BigInt::New(env->isolate(), value)).IsEmpty(); + USE(map->Set( + env->context(), + Number::New(env->isolate(), key), + BigInt::New(env->isolate(), value))); }); } @@ -589,10 +589,10 @@ void IntervalHistogram::GetPercentiles( CHECK(args[0]->IsMap()); Local map = args[0].As(); (*histogram)->Percentiles([map, env](double key, int64_t value) { - map->Set( - env->context(), - Number::New(env->isolate(), key), - Number::New(env->isolate(), static_cast(value))).IsEmpty(); + USE(map->Set( + env->context(), + Number::New(env->isolate(), key), + Number::New(env->isolate(), static_cast(value)))); }); } @@ -604,10 +604,10 @@ void IntervalHistogram::GetPercentilesBigInt( CHECK(args[0]->IsMap()); Local map = args[0].As(); (*histogram)->Percentiles([map, env](double key, int64_t value) { - map->Set( - env->context(), - Number::New(env->isolate(), key), - BigInt::New(env->isolate(), value)).IsEmpty(); + USE(map->Set( + env->context(), + Number::New(env->isolate(), key), + BigInt::New(env->isolate(), value))); }); }