Skip to content

Commit 14cb9ea

Browse files
mhdawsonruyadorno
authored andcommitted
perf_hooks: remove useless calls in Histogram
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]>
1 parent cfaa1e2 commit 14cb9ea

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/histogram.cc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ void HistogramBase::GetPercentiles(const FunctionCallbackInfo<Value>& args) {
159159
CHECK(args[0]->IsMap());
160160
Local<Map> map = args[0].As<Map>();
161161
(*histogram)->Percentiles([map, env](double key, int64_t value) {
162-
map->Set(
163-
env->context(),
164-
Number::New(env->isolate(), key),
165-
Number::New(env->isolate(), static_cast<double>(value))).IsEmpty();
162+
USE(map->Set(
163+
env->context(),
164+
Number::New(env->isolate(), key),
165+
Number::New(env->isolate(), static_cast<double>(value))));
166166
});
167167
}
168168

@@ -174,10 +174,10 @@ void HistogramBase::GetPercentilesBigInt(
174174
CHECK(args[0]->IsMap());
175175
Local<Map> map = args[0].As<Map>();
176176
(*histogram)->Percentiles([map, env](double key, int64_t value) {
177-
map->Set(
178-
env->context(),
179-
Number::New(env->isolate(), key),
180-
BigInt::New(env->isolate(), value)).IsEmpty();
177+
USE(map->Set(
178+
env->context(),
179+
Number::New(env->isolate(), key),
180+
BigInt::New(env->isolate(), value)));
181181
});
182182
}
183183

@@ -589,10 +589,10 @@ void IntervalHistogram::GetPercentiles(
589589
CHECK(args[0]->IsMap());
590590
Local<Map> map = args[0].As<Map>();
591591
(*histogram)->Percentiles([map, env](double key, int64_t value) {
592-
map->Set(
593-
env->context(),
594-
Number::New(env->isolate(), key),
595-
Number::New(env->isolate(), static_cast<double>(value))).IsEmpty();
592+
USE(map->Set(
593+
env->context(),
594+
Number::New(env->isolate(), key),
595+
Number::New(env->isolate(), static_cast<double>(value))));
596596
});
597597
}
598598

@@ -604,10 +604,10 @@ void IntervalHistogram::GetPercentilesBigInt(
604604
CHECK(args[0]->IsMap());
605605
Local<Map> map = args[0].As<Map>();
606606
(*histogram)->Percentiles([map, env](double key, int64_t value) {
607-
map->Set(
608-
env->context(),
609-
Number::New(env->isolate(), key),
610-
BigInt::New(env->isolate(), value)).IsEmpty();
607+
USE(map->Set(
608+
env->context(),
609+
Number::New(env->isolate(), key),
610+
BigInt::New(env->isolate(), value)));
611611
});
612612
}
613613

0 commit comments

Comments
 (0)