Merge pull request #13 from dwbuiten/goto1

srt: Factor out a goto statement
This commit is contained in:
Thomas Goyne 2014-06-30 13:08:14 -07:00
commit c1a7ba0009

View file

@ -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;