Decompile fn_13882 (ExtractTextTags)
Batch #11667 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_13882 ExtractTextTags: logic confirmed by peer review Peer-reviewed-by: Yommy, KWDev Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
085ef43849
commit
5bd22f501c
1 changed files with 5 additions and 5 deletions
|
|
@ -6,24 +6,24 @@ std::vector<STagString> ExtractTextTags(std::string text) {
|
|||
std::vector<STagString> tags;
|
||||
int index = 0;
|
||||
|
||||
for (const CTagPrototype& prototype : g_textTagRegistry) {
|
||||
for (auto prototype = g_textTagRegistry.begin(); prototype != g_textTagRegistry.end(); ++prototype) {
|
||||
std::string remaining = text;
|
||||
|
||||
for (std::size_t offset = 0; offset < text.size();) {
|
||||
const std::size_t begin = remaining.find(prototype.opening);
|
||||
const std::size_t begin = remaining.find(prototype->opening);
|
||||
|
||||
if (begin == std::string::npos) {
|
||||
break;
|
||||
}
|
||||
|
||||
std::size_t end = remaining.find(prototype.closing);
|
||||
std::size_t end = remaining.find(prototype->closing);
|
||||
std::size_t advance;
|
||||
|
||||
if (end == std::string::npos) {
|
||||
advance = prototype.opening.size();
|
||||
advance = prototype->opening.size();
|
||||
remaining.erase(0, advance);
|
||||
} else {
|
||||
end += prototype.closing.size();
|
||||
end += prototype->closing.size();
|
||||
STagString tag(index, offset + begin, remaining.substr(begin, end - begin));
|
||||
tags.push_back(tag);
|
||||
remaining.erase(0, end);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue