Skip to content

Commit

Permalink
perf_hooks: remove useless calls in Histogram
Browse files Browse the repository at this point in the history
Coverity reported some calls that had no effect,
remove them

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: nodejs#41579
Reviewed-By: Yash Ladha <yash@yashladha.in>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
  • Loading branch information
mhdawson authored and Linkgoron committed Jan 31, 2022
1 parent 4ef510f commit 19eeebb
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/histogram.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ void HistogramBase::GetPercentiles(const FunctionCallbackInfo<Value>& args) {
CHECK(args[0]->IsMap());
Local<Map> map = args[0].As<Map>();
(*histogram)->Percentiles([map, env](double key, int64_t value) {
map->Set(
env->context(),
Number::New(env->isolate(), key),
Number::New(env->isolate(), static_cast<double>(value))).IsEmpty();
USE(map->Set(
env->context(),
Number::New(env->isolate(), key),
Number::New(env->isolate(), static_cast<double>(value))));
});
}

Expand All @@ -174,10 +174,10 @@ void HistogramBase::GetPercentilesBigInt(
CHECK(args[0]->IsMap());
Local<Map> map = args[0].As<Map>();
(*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)));
});
}

Expand Down Expand Up @@ -589,10 +589,10 @@ void IntervalHistogram::GetPercentiles(
CHECK(args[0]->IsMap());
Local<Map> map = args[0].As<Map>();
(*histogram)->Percentiles([map, env](double key, int64_t value) {
map->Set(
env->context(),
Number::New(env->isolate(), key),
Number::New(env->isolate(), static_cast<double>(value))).IsEmpty();
USE(map->Set(
env->context(),
Number::New(env->isolate(), key),
Number::New(env->isolate(), static_cast<double>(value))));
});
}

Expand All @@ -604,10 +604,10 @@ void IntervalHistogram::GetPercentilesBigInt(
CHECK(args[0]->IsMap());
Local<Map> map = args[0].As<Map>();
(*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)));
});
}

Expand Down

0 comments on commit 19eeebb

Please sign in to comment.