Removed redundant if statements where possible

This commit is contained in:
Vladyslav Baranovskyi
2024-12-20 16:10:10 +02:00
parent 90440b3f34
commit 947faebe9c
4 changed files with 20 additions and 81 deletions

View File

@@ -73,11 +73,7 @@ namespace OpenVulkano
size_t SystemInfo::GetSystemRam()
{
static size_t ram;
if (ram == 0)
{
ram = ReadMemInfo("MemTotal");
}
static const size_t ram = ReadMemInfo("MemTotal");
return ram;
}
@@ -314,11 +310,7 @@ namespace OpenVulkano
size_t SystemInfo::GetCpuThreadCount()
{
static size_t threadCount;
if (threadCount == 0)
{
threadCount = std::thread::hardware_concurrency();
}
static const size_t threadCount = std::thread::hardware_concurrency();
return threadCount;
}