Skip to content

Commit

Permalink
skip empty values for bitwise extensible enum (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinming-Hu authored Feb 24, 2022
1 parent 4f46235 commit f1e1d1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cppCodeBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,15 @@ export class ModelEnumDefinition implements CodeBlock {
size_t cur = 0;
while (cur != std::string::npos) {
auto delimiter_pos = value.find(delimiter, cur);
std::string v;
if (delimiter_pos == std::string::npos) {
m_value.push_back(value.substr(cur));
v = value.substr(cur);
cur = delimiter_pos;
} else {
m_value.push_back(value.substr(cur, delimiter_pos - cur));
v = value.substr(cur, delimiter_pos - cur);
cur = delimiter_pos + delimiter.size();
}
if (!v.empty()) {m_value.push_back(std::move(v));}
}
std::sort(m_value.begin(), m_value.end());
}
Expand Down

0 comments on commit f1e1d1f

Please sign in to comment.