forked from mia/Aegisub
Add some special cases to line_iterator that makes it significantly faster in common cases
Originally committed to SVN as r5534.
This commit is contained in:
parent
561216d4c8
commit
330411c94a
1 changed files with 14 additions and 5 deletions
|
@ -191,12 +191,21 @@ void line_iterator<OutputType>::next() {
|
||||||
valid = false;
|
valid = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::string str;
|
std::string str, cstr, *target;
|
||||||
getline(str);
|
if (width == 1) {
|
||||||
if (conv.get()) {
|
std::getline(*stream, str);
|
||||||
str = conv->Convert(str);
|
|
||||||
}
|
}
|
||||||
if (!convert(str)) {
|
else {
|
||||||
|
getline(str);
|
||||||
|
}
|
||||||
|
if (conv.get()) {
|
||||||
|
conv->Convert(str, cstr);
|
||||||
|
target = &cstr;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
target = &str;
|
||||||
|
}
|
||||||
|
if (!convert(*target)) {
|
||||||
next();
|
next();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue