Use empty() instead of comparing with size()
MODIFY
src/vcpkg.cpp
src/vcpkg.cpp
@@ -214,7 +214,7 @@ static void load_config()
static std::string trim_path_from_command_line(const std::string& full_command_line)
{
Checks::check_exit(
- VCPKG_LINE_INFO, full_command_line.size() > 0, "Internal failure - cannot have empty command line");
+ VCPKG_LINE_INFO, !full_command_line.empty(), "Internal failure - cannot have empty command line");
if (full_command_line[0] == '"')
{

MODIFY
src/vcpkg/build.cpp
src/vcpkg/build.cpp
@@ -296,7 +296,7 @@ namespace vcpkg::Build
{
features.append(feature + ";");
}
- if (features.size() > 0)
+ if (!features.empty())
{
features.pop_back();
}

MODIFY
src/vcpkg/commands.cache.cpp
src/vcpkg/commands.cache.cpp
@@ -47,7 +47,7 @@ namespace vcpkg::Commands::Cache
Checks::exit_success(VCPKG_LINE_INFO);
}
- if (args.command_arguments.size() == 0)
+ if (args.command_arguments.empty())
{
for (const BinaryParagraph& binary_paragraph : binary_paragraphs)
{

Use empty() instead of comparing with size()