replace gotos with tail calls where appropriate

This commit is contained in:
Devin J. Pohly
2013-01-25 17:22:23 -05:00
parent 7bdfc454ae
commit 001ee51242
2 changed files with 4 additions and 5 deletions
+2 -3
View File
@@ -274,7 +274,6 @@ apActorCommands NoteSkinManager::GetMetricA( const RString &sButtonName, const R
RString NoteSkinManager::GetPath( const RString &sButtonName, const RString &sElement )
{
try_again:
const RString CacheString = m_sCurrentNoteSkin + "/" + sButtonName + "/" + sElement;
map<RString,RString>::iterator it = g_PathCache.find( CacheString );
if( it != g_PathCache.end() )
@@ -327,7 +326,7 @@ try_again:
FOREACH_CONST( RString, data.vsDirSearchOrder, dir )
FILEMAN->FlushDirCache( *dir );
g_PathCache.clear();
goto try_again;
return GetPath( sButtonName, sElement );
}
RageException::Throw( "%s", message.c_str() );
@@ -362,7 +361,7 @@ try_again:
FOREACH_CONST( RString, data.vsDirSearchOrder, dir )
FILEMAN->FlushDirCache( *dir );
g_PathCache.clear();
goto try_again;
return GetPath( sButtonName, sElement );
}
RageException::Throw( "%s", message.c_str() );
+2 -2
View File
@@ -668,7 +668,7 @@ try_element_again:
break;
case Dialog::retry:
ReloadMetrics();
goto try_element_again;
return GetPathInfoToRaw( out, sThemeName_, category, sMetricsGroup_, sElement_ );
case Dialog::ignore:
break;
}
@@ -710,7 +710,7 @@ try_element_again:
{
case Dialog::retry:
ReloadMetrics();
goto try_element_again;
return GetPathInfoToRaw( out, sThemeName_, category, sMetricsGroup_, sElement_ );
case Dialog::ignore:
GetPathInfo( out, category, "", "_missing" );
return true;