1
0
mirror of https://github.com/google/benchmark.git synced 2025-04-29 14:30:37 +08:00

perf_counters: Make success var const

This commit is contained in:
Jesse Rosenstock 2023-08-24 08:12:33 +02:00
parent cb5fc2d77a
commit 71a7d88530

View File

@ -61,7 +61,9 @@ const bool PerfCounters::kSupported = true;
// initialization was successful
static bool InitLibPfmOnce() {
// Function-scope static gets initialized only once on first call.
static bool success = []() { return pfm_initialize() == PFM_SUCCESS; }();
static const bool success = []() {
return pfm_initialize() == PFM_SUCCESS;
}();
return success;
}