fix empty lic

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
zhoufeng 2021-07-06 21:10:24 +08:00
parent 83d6ab79e1
commit d5e36f5a46
1 changed files with 5 additions and 5 deletions

View File

@ -98,25 +98,25 @@ void LicManager::ParseSwitch() {
}
void LicManager::ParseFeSwitch(const std::map<std::string, std::string> &options_map) {
// no fe switch, open all
auto options_iter = options_map.find(kFeKey);
if (options_iter == options_map.end()) {
return;
}
const auto &options_str = options_iter->second;
// invalid options, do nothing.
if (options_str.empty()) {
return;
}
// "All" in options means all open, do nothing.
const auto &options_str = options_iter->second;
if (options_str.find(kAllOpen) != std::string::npos) {
return;
}
// close all first
for (auto iter = kPassCodeMap.begin(); iter != kPassCodeMap.end(); ++iter) {
auto pass = iter->second;
pass_switch_.emplace(pass, false);
}
// then open passes in options
auto fe_pass = SplitStrByRegex(options_str, ":");
for (auto &pass_code : fe_pass) {
auto iter = kPassCodeMap.find(pass_code);