[vcpkg_Build.h] Naming scheme, unneeded #include, unneeded inline

This commit is contained in:
Alexander Karatarakis 2017-09-07 16:16:30 -07:00
Родитель 3ac99b2cee
Коммит d2de7d3e7d
3 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -9,7 +9,6 @@
#include <array> #include <array>
#include <map> #include <map>
#include <unordered_map>
#include <vector> #include <vector>
namespace vcpkg::Build namespace vcpkg::Build
@ -56,7 +55,7 @@ namespace vcpkg::Build
CASCADED_DUE_TO_MISSING_DEPENDENCIES CASCADED_DUE_TO_MISSING_DEPENDENCIES
}; };
static constexpr std::array<BuildResult, 5> BuildResult_values = { static constexpr std::array<BuildResult, 5> BUILD_RESULT_VALUES = {
BuildResult::SUCCEEDED, BuildResult::SUCCEEDED,
BuildResult::BUILD_FAILED, BuildResult::BUILD_FAILED,
BuildResult::POST_BUILD_CHECKS_FAILED, BuildResult::POST_BUILD_CHECKS_FAILED,
@ -143,7 +142,7 @@ namespace vcpkg::Build
COUNT, COUNT,
}; };
constexpr std::array<BuildPolicy, size_t(BuildPolicy::COUNT)> g_all_policies = { constexpr std::array<BuildPolicy, size_t(BuildPolicy::COUNT)> G_ALL_POLICIES = {
BuildPolicy::EMPTY_PACKAGE, BuildPolicy::EMPTY_PACKAGE,
BuildPolicy::DLLS_WITHOUT_LIBS, BuildPolicy::DLLS_WITHOUT_LIBS,
BuildPolicy::ONLY_RELEASE_CRT, BuildPolicy::ONLY_RELEASE_CRT,
@ -159,7 +158,7 @@ namespace vcpkg::Build
BuildPolicies() = default; BuildPolicies() = default;
BuildPolicies(std::map<BuildPolicy, bool>&& map) : m_policies(std::move(map)) {} BuildPolicies(std::map<BuildPolicy, bool>&& map) : m_policies(std::move(map)) {}
inline bool is_enabled(BuildPolicy policy) const bool is_enabled(BuildPolicy policy) const
{ {
const auto it = m_policies.find(policy); const auto it = m_policies.find(policy);
if (it != m_policies.cend()) return it->second; if (it != m_policies.cend()) return it->second;

Просмотреть файл

@ -77,7 +77,7 @@ namespace vcpkg::Commands::CI
} }
std::map<BuildResult, int> summary; std::map<BuildResult, int> summary;
for (const BuildResult& v : Build::BuildResult_values) for (const BuildResult& v : Build::BUILD_RESULT_VALUES)
{ {
summary[v] = 0; summary[v] = 0;
} }

Просмотреть файл

@ -289,7 +289,7 @@ namespace vcpkg::Build
if (!version.empty()) build_info.version = std::move(version); if (!version.empty()) build_info.version = std::move(version);
std::map<BuildPolicy, bool> policies; std::map<BuildPolicy, bool> policies;
for (auto policy : g_all_policies) for (auto policy : G_ALL_POLICIES)
{ {
const auto setting = parser.optional_field(to_string(policy)); const auto setting = parser.optional_field(to_string(policy));
if (setting.empty()) continue; if (setting.empty()) continue;