@@ -25,10 +25,10 @@ class CommandLineConfigLayerLoader final : public Config::ConfigLayerLoader
const std::string& audio_backend)
: ConfigLayerLoader(Config::LayerType::CommandLine)
{
if (video_backend.size())
if (!video_backend.empty())
m_values.emplace_back(std::make_tuple(Config::MAIN_GFX_BACKEND.location, video_backend));

if (audio_backend.size())
if (!audio_backend.empty())
m_values.emplace_back(
std::make_tuple(Config::MAIN_DSP_HLE.location, ValueToString(audio_backend == "HLE")));

@@ -232,7 +232,7 @@ bool GameFileCache::SyncCacheFile(bool save)
else
{
std::vector<u8> buffer(f.GetSize());
if (buffer.size() && f.ReadBytes(buffer.data(), buffer.size()))
if (!buffer.empty() && f.ReadBytes(buffer.data(), buffer.size()))
{
u8* ptr = buffer.data();
PointerWrap p(&ptr, PointerWrap::MODE_READ);
@@ -890,7 +890,7 @@ void Renderer::UpdateEFBCache(EFBAccessType type, u32 cacheRectIdx, const EFBRec
{
const u32 cacheType = (type == EFBAccessType::PeekZ ? 0 : 1);

if (!s_efbCache[cacheType][cacheRectIdx].size())
if (s_efbCache[cacheType][cacheRectIdx].empty())
s_efbCache[cacheType][cacheRectIdx].resize(EFB_CACHE_RECT_SIZE * EFB_CACHE_RECT_SIZE);

u32 targetPixelRcWidth = targetPixelRc.right - targetPixelRc.left;
@@ -70,7 +70,7 @@ PostProcessingShaderConfiguration::~PostProcessingShaderConfiguration() = defaul
std::string PostProcessingShaderConfiguration::LoadShader(std::string shader)
{
// Load the shader from the configuration if there isn't one sent to us.
if (shader == "")
if (shader.empty())
shader = g_ActiveConfig.sPostProcessingShader;
m_current_shader = shader;

@@ -81,7 +81,7 @@ std::string PostProcessingShaderConfiguration::LoadShader(std::string shader)
std::string code;
std::string path = File::GetUserPath(D_SHADERS_IDX) + sub_dir + shader + ".glsl";

if (shader == "")
if (shader.empty())
{
code = s_default_shader;
}
@@ -150,7 +150,7 @@ void PostProcessingShaderConfiguration::LoadOptions(const std::string& code)
}
#endif

if (line.size() > 0)
if (!line.empty())
{
if (line[0] == '[')
{
@@ -171,7 +171,7 @@ void PostProcessingShaderConfiguration::LoadOptions(const std::string& code)
std::string key, value;
IniFile::ParseLine(line, &key, &value);

if (!(key == "" && value == ""))
if (!(key.empty() && value.empty()))
current_strings->m_options.emplace_back(key, value);
}
}
@@ -272,15 +272,15 @@ void PostProcessingShaderConfiguration::LoadOptionsConfiguration()
{
std::string value;
ini.GetOrCreateSection(section)->Get(it.second.m_option_name, &value);
if (value != "")
if (!value.empty())
TryParseVector(value, &it.second.m_integer_values);
}
break;
case ConfigurationOption::OptionType::OPTION_FLOAT:
{
std::string value;
ini.GetOrCreateSection(section)->Get(it.second.m_option_name, &value);
if (value != "")
if (!value.empty())
TryParseVector(value, &it.second.m_float_values);
}
break;