mirror of
https://github.com/google/benchmark.git
synced 2024-12-28 05:20:14 +08:00
Fix a -Wunreachable-code-aggressive warning (#1214)
This commit is contained in:
parent
c4b06e5b79
commit
8fd49d6671
@ -214,10 +214,9 @@ bool ReadFromFile(std::string const& fname, ArgT* arg) {
|
||||
CPUInfo::Scaling CpuScaling(int num_cpus) {
|
||||
// We don't have a valid CPU count, so don't even bother.
|
||||
if (num_cpus <= 0) return CPUInfo::Scaling::UNKNOWN;
|
||||
#ifdef BENCHMARK_OS_QNX
|
||||
#if defined(BENCHMARK_OS_QNX)
|
||||
return CPUInfo::Scaling::UNKNOWN;
|
||||
#endif
|
||||
#ifndef BENCHMARK_OS_WINDOWS
|
||||
#elif !defined(BENCHMARK_OS_WINDOWS)
|
||||
// On Linux, the CPUfreq subsystem exposes CPU information as files on the
|
||||
// local file system. If reading the exported files fails, then we may not be
|
||||
// running on Linux, so we silently ignore all the read errors.
|
||||
@ -228,8 +227,9 @@ CPUInfo::Scaling CpuScaling(int num_cpus) {
|
||||
if (ReadFromFile(governor_file, &res) && res != "performance") return CPUInfo::Scaling::ENABLED;
|
||||
}
|
||||
return CPUInfo::Scaling::DISABLED;
|
||||
#endif
|
||||
#else
|
||||
return CPUInfo::Scaling::UNKNOWN;
|
||||
#endif
|
||||
}
|
||||
|
||||
int CountSetBitsInCPUMap(std::string Val) {
|
||||
|
Loading…
Reference in New Issue
Block a user