Merge pull request #13 from dwbuiten/goto1
srt: Factor out a goto statement
This commit is contained in:
commit
c1a7ba0009
1 changed files with 3 additions and 3 deletions
|
@ -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 a new issue