mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-04 02:34:06 +00:00
Fix conversion of some logical rules in Surge configurations
Optimize codes.
This commit is contained in:
2 files changed
+3
-2
No files matched your search
+2
-2
@@ -848,7 +848,7 @@ void rulesetToSurge(INIReader &base_rule, std::vector<ruleset_content> &ruleset_
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(count_least(strLine, ',', 3))
|
if(!startsWith(strLine, "AND") && !startsWith(strLine, "OR") && !startsWith(strLine, "NOT") && count_least(strLine, ',', 3))
|
||||||
strLine = regReplace(strLine, rule_match_regex, "$1$3$2");
|
strLine = regReplace(strLine, rule_match_regex, "$1$3$2");
|
||||||
}
|
}
|
||||||
strLine = replace_all_distinct(strLine, ",,", ",");
|
strLine = replace_all_distinct(strLine, ",,", ",");
|
||||||
@@ -987,7 +987,7 @@ void rulesetToSurge(INIReader &base_rule, std::vector<ruleset_content> &ruleset_
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(count_least(strLine, ',', 3))
|
if(!startsWith(strLine, "AND") && !startsWith(strLine, "OR") && !startsWith(strLine, "NOT") && count_least(strLine, ',', 3))
|
||||||
strLine = regReplace(strLine, rule_match_regex, "$1$3$2");
|
strLine = regReplace(strLine, rule_match_regex, "$1$3$2");
|
||||||
}
|
}
|
||||||
allRules.emplace_back(std::move(strLine));
|
allRules.emplace_back(std::move(strLine));
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ int render_template(const std::string &content, const template_args &vars, std::
|
|||||||
switch(hash_(value))
|
switch(hash_(value))
|
||||||
{
|
{
|
||||||
case "true"_hash:
|
case "true"_hash:
|
||||||
|
case "1"_hash:
|
||||||
return 1;
|
return 1;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in new issue
Block a user