mirror of https://github.com/odrling/Aegisub
Merge pull request #13 from dwbuiten/goto1
srt: Factor out a goto statement
This commit is contained in:
commit
c1a7ba0009
|
@ -283,7 +283,7 @@ AssTime ReadSRTTime(std::string const& ts)
|
|||
size_t ci = 0;
|
||||
int ms_chars = 0;
|
||||
|
||||
for (; ci < ts.size(); ++ci)
|
||||
for (bool milliseconds = false; ci < ts.size() && !milliseconds; ++ci)
|
||||
{
|
||||
switch (ts[ci])
|
||||
{
|
||||
|
@ -298,13 +298,13 @@ AssTime ReadSRTTime(std::string const& ts)
|
|||
break;
|
||||
case ',':
|
||||
ci++;
|
||||
goto milliseconds;
|
||||
milliseconds = true;
|
||||
break;
|
||||
default:
|
||||
ci = ts.size();
|
||||
}
|
||||
}
|
||||
|
||||
milliseconds:
|
||||
for (; ci < ts.size(); ++ci)
|
||||
{
|
||||
if (!isdigit(ts[ci])) break;
|
||||
|
|
Loading…
Reference in New Issue