Remove unneeded empty checks

This commit is contained in:
Kevin Sawicki 2016-12-12 12:42:30 -08:00
parent 04fa85f67f
commit 381f55b3cb
2 changed files with 8 additions and 15 deletions

View file

@ -197,10 +197,9 @@ void AtomContentClient::AddServiceWorkerSchemes(
std::vector<std::string> schemes; std::vector<std::string> schemes;
ConvertStringWithSeparatorToVector(&schemes, ",", ConvertStringWithSeparatorToVector(&schemes, ",",
switches::kRegisterServiceWorkerSchemes); switches::kRegisterServiceWorkerSchemes);
if (!schemes.empty()) {
for (const std::string& scheme : schemes) for (const std::string& scheme : schemes)
service_worker_schemes->insert(scheme); service_worker_schemes->insert(scheme);
}
service_worker_schemes->insert(url::kFileScheme); service_worker_schemes->insert(url::kFileScheme);
} }
@ -210,11 +209,8 @@ void AtomContentClient::AddSecureSchemesAndOrigins(
std::vector<std::string> schemes; std::vector<std::string> schemes;
ConvertStringWithSeparatorToVector(&schemes, ",", ConvertStringWithSeparatorToVector(&schemes, ",",
switches::kSecureSchemes); switches::kSecureSchemes);
if (!schemes.empty()) { for (const std::string& scheme : schemes)
for (const std::string& scheme : schemes) {
secure_schemes->insert(scheme); secure_schemes->insert(scheme);
}
}
} }

View file

@ -124,10 +124,7 @@ bool IsDevToolsExtension(content::RenderFrame* render_frame) {
std::vector<std::string> ParseSchemesCLISwitch(const char* switch_name) { std::vector<std::string> ParseSchemesCLISwitch(const char* switch_name) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
std::string custom_schemes = command_line->GetSwitchValueASCII(switch_name); std::string custom_schemes = command_line->GetSwitchValueASCII(switch_name);
if (!custom_schemes.empty()) {
return base::SplitString(custom_schemes, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); return base::SplitString(custom_schemes, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
}
return std::vector<std::string>();
} }
} // namespace } // namespace