mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-07-15 22:54:33 +00:00
Minor adjustments to reIterBegin and reIterNext
This commit is contained in:
parent
bf3ff3caba
commit
b4bbf80dcb
1 changed files with 4 additions and 2 deletions
|
|
@ -459,7 +459,6 @@ bool reIterBegin(Linker::SimObject* obj, S32 argc, const char* argv[])
|
||||||
currentRegex = std::regex(argv[1], std::regex::extended);
|
currentRegex = std::regex(argv[1], std::regex::extended);
|
||||||
currentString = std::string(argv[2]);
|
currentString = std::string(argv[2]);
|
||||||
matchBegin = std::sregex_iterator(currentString.begin(), currentString.end(), currentRegex);
|
matchBegin = std::sregex_iterator(currentString.begin(), currentString.end(), currentRegex);
|
||||||
matchEnd = std::sregex_iterator();
|
|
||||||
currentMatchIter = matchBegin;
|
currentMatchIter = matchBegin;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -480,8 +479,11 @@ bool reIterEnd(Linker::SimObject* obj, S32 argc, const char* argv[])
|
||||||
|
|
||||||
const char* reIterNext(Linker::SimObject* obj, S32 argc, const char* argv[])
|
const char* reIterNext(Linker::SimObject* obj, S32 argc, const char* argv[])
|
||||||
{
|
{
|
||||||
|
if (currentMatchIter == matchEnd)
|
||||||
|
return "-1";
|
||||||
|
|
||||||
std::string currentResult = (*currentMatchIter).str();
|
std::string currentResult = (*currentMatchIter).str();
|
||||||
++currentMatchIter;
|
++currentMatchIter;
|
||||||
|
|
||||||
return currentResult.c_str();
|
return currentResult.data();
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue