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

@@ -426,7 +426,7 @@ namespace OpenVulkano
OsVersion SystemInfo::GetOsVersion()
{
static OsVersion osVersion;
static OsVersion osVersion = {};
if (osVersion.major == 0 && osVersion.minor == 0)
{
NTSTATUS(WINAPI * RtlGetVersion)(LPOSVERSIONINFOEXW);
@@ -441,11 +441,7 @@ namespace OpenVulkano
std::string SystemInfo::GetOsNameHumanReadable()
{
static std::string osName;
if (osName.empty())
{
osName = GetHumanReadableOSName();
}
static const std::string osName = GetHumanReadableOSName();
return osName;
}
@@ -456,7 +452,7 @@ namespace OpenVulkano
size_t SystemInfo::GetCpuCoreCount()
{
static size_t coreCount;
static size_t coreCount = 0;
if (coreCount == 0)
{
DWORD bufferSize = 0;