From 0e4e3aa9326696ba85103ac4f994ba854b2deb0e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 15 Jan 2006 23:03:31 +0000 Subject: [PATCH] These code paths all call Init() and defOut.Init, including the fall-through case. Merge them. (They're all a little wrong: they clear m_cmds, which causes a crash later in ImportOption on the error case, which is what I'm really trying to fix ...) --- stepmania/src/OptionRowHandler.cpp | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index 20a576e033..a220cf65a7 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -81,6 +81,9 @@ public: ASSERT( command.m_vsArgs.size() == 2 ); ASSERT( sParam.size() ); + Init(); + defOut.Init(); + if( sParam.CompareNoCase("NoteSkins")==0 ) { FillNoteSkins( defOut, sParam ); return; } else if( sParam.CompareNoCase("Steps")==0 ) { FillSteps( defOut, sParam, false ); return; } else if( sParam.CompareNoCase("StepsLocked")==0 ) { FillSteps( defOut, sParam, true ); return; } @@ -90,9 +93,6 @@ public: else if( sParam.CompareNoCase("Difficulties")==0 ) { FillDifficulties( defOut, sParam ); return; } else if( sParam.CompareNoCase("SongsInCurrentSongGroup")==0 ) { FillSongsInCurrentSongGroup( defOut, sParam ); return; } - Init(); - defOut.Init(); - m_bUseModNameForIcon = true; defOut.m_sName = sParam; @@ -270,9 +270,6 @@ public: void FillNoteSkins( OptionRowDefinition &defOut, CString sParam ) { - Init(); - defOut.Init(); - ASSERT( sParam.size() ); defOut.m_sName = "NoteSkins"; @@ -292,9 +289,6 @@ public: void FillSteps( OptionRowDefinition &defOut, CString sParam, bool bLockedTogether ) { - Init(); - defOut.Init(); - ASSERT( sParam.size() ); defOut.m_sName = "Steps"; @@ -353,9 +347,6 @@ public: void FillCharacters( OptionRowDefinition &defOut, CString sParam ) { - Init(); - defOut.Init(); - ASSERT( sParam.size() ); defOut.m_bOneChoiceForAllPlayers = false; @@ -387,9 +378,6 @@ public: void FillStyles( OptionRowDefinition &defOut, CString sParam ) { - Init(); - defOut.Init(); - ASSERT( sParam.size() ); defOut.m_bOneChoiceForAllPlayers = true; @@ -412,9 +400,6 @@ public: void FillGroups( OptionRowDefinition &defOut, CString sParam ) { - Init(); - defOut.Init(); - ASSERT( sParam.size() ); defOut.m_bOneChoiceForAllPlayers = true; @@ -444,9 +429,6 @@ public: void FillDifficulties( OptionRowDefinition &defOut, CString sParam ) { - Init(); - defOut.Init(); - ASSERT( sParam.size() ); defOut.m_bOneChoiceForAllPlayers = true; @@ -474,9 +456,6 @@ public: void FillSongsInCurrentSongGroup( OptionRowDefinition &defOut, CString sParam ) { - Init(); - defOut.Init(); - ASSERT( sParam.size() ); vector vpSongs;