mirror of https://github.com/odrling/Aegisub
Avoid running the extradata parsing regex unnecessarily
This commit is contained in:
parent
bddf44ddde
commit
d8bd9904d8
|
@ -123,6 +123,7 @@ void AssDialogue::Parse(std::string const& raw) {
|
|||
|
||||
std::string text{tkn.next_tok().begin(), str.end()};
|
||||
|
||||
if (text.size() > 1 && text[0] == '{' && text[1] == '=') {
|
||||
static const boost::regex extradata_test("^\\{(=\\d+)+\\}");
|
||||
boost::match_results<std::string::iterator> rematch;
|
||||
if (boost::regex_search(text.begin(), text.end(), rematch, extradata_test)) {
|
||||
|
@ -140,6 +141,7 @@ void AssDialogue::Parse(std::string const& raw) {
|
|||
}
|
||||
ExtradataIds = ids;
|
||||
}
|
||||
}
|
||||
|
||||
Text = text;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue