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 <[email protected]>

PR-URL: #41579
Reviewed-By: Yash Ladha <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
mhdawson authored and ruyadorno committed Feb 7, 2022
1 parent cfaa1e2 commit 14cb9ea
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 14cb9ea

Please sign in to comment.