feat update

This commit is contained in:
tqcq 2024-03-06 09:01:30 +08:00
parent cf664d8143
commit b6425fa20f

View File

@ -32,8 +32,7 @@ RemoveWhiteSpace(const std::string &name, const std::string &chars = "[]<>,&* ")
if (compact_name[i] == ' ') {
if (i > 0 && chars.find(compact_name[i - 1]) != std::string::npos) {
compact_name.erase(i, 1);
} else if (i + 1 < compact_name.size()
&& chars.find(compact_name[i + 1]) != std::string::npos) {
} else if (i + 1 < compact_name.size() && chars.find(compact_name[i + 1]) != std::string::npos) {
compact_name.erase(i, 1);
}
}
@ -45,10 +44,10 @@ inline std::string
RemoveInnerNamespace(const std::string &name)
{
std::string new_name = name;
auto iter = name.find("::__1");
while (iter != std::string::npos) {
new_name.replace(iter, 5, "");
iter = new_name.find("::__1");
while (true) {
auto iter = name.find("::__1::");
if (iter == std::string::npos) { break; }
new_name.replace(iter, 5, "::");
}
return new_name;
}