Skip to content

Commit 8bb3e5a

Browse files
committed
[USETUP] Minor simplifications in some branching code
1 parent 30b4024 commit 8bb3e5a

File tree

1 file changed

+7
-30
lines changed

1 file changed

+7
-30
lines changed

base/setup/usetup/usetup.c

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,7 @@ LanguagePage(PINPUT_RECORD Ir)
727727
{
728728
if (ConfirmQuit(Ir))
729729
return QUIT_PAGE;
730-
else
731-
RedrawGenericList(&ListUi);
730+
RedrawGenericList(&ListUi);
732731
}
733732
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
734733
{
@@ -818,7 +817,6 @@ WelcomePage(PINPUT_RECORD Ir)
818817
{
819818
if (ConfirmQuit(Ir))
820819
return QUIT_PAGE;
821-
822820
break;
823821
}
824822
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
@@ -995,8 +993,7 @@ UpgradeRepairPage(PINPUT_RECORD Ir)
995993
{
996994
if (ConfirmQuit(Ir))
997995
return QUIT_PAGE;
998-
else
999-
RedrawGenericList(&ListUi);
996+
RedrawGenericList(&ListUi);
1000997
break;
1001998
}
1002999
#if 1
@@ -1105,7 +1102,6 @@ InstallIntroPage(PINPUT_RECORD Ir)
11051102
{
11061103
if (ConfirmQuit(Ir))
11071104
return QUIT_PAGE;
1108-
11091105
break;
11101106
}
11111107
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
@@ -1142,7 +1138,6 @@ ScsiControllerPage(PINPUT_RECORD Ir)
11421138
{
11431139
if (ConfirmQuit(Ir))
11441140
return QUIT_PAGE;
1145-
11461141
break;
11471142
}
11481143
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
@@ -1174,7 +1169,6 @@ OemDriverPage(PINPUT_RECORD Ir)
11741169
{
11751170
if (ConfirmQuit(Ir))
11761171
return QUIT_PAGE;
1177-
11781172
break;
11791173
}
11801174
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
@@ -1311,7 +1305,6 @@ DeviceSettingsPage(PINPUT_RECORD Ir)
13111305
{
13121306
if (ConfirmQuit(Ir))
13131307
return QUIT_PAGE;
1314-
13151308
break;
13161309
}
13171310
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
@@ -1375,8 +1368,7 @@ HandleGenericList(PGENERIC_LIST_UI ListUi,
13751368
{
13761369
if (ConfirmQuit(Ir))
13771370
return QUIT_PAGE;
1378-
else
1379-
RedrawGenericList(ListUi);
1371+
RedrawGenericList(ListUi);
13801372
}
13811373
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE) /* ESC */
13821374
{
@@ -1687,7 +1679,6 @@ SelectPartitionPage(PINPUT_RECORD Ir)
16871679
PartitionList = NULL;
16881680
return QUIT_PAGE;
16891681
}
1690-
16911682
break;
16921683
}
16931684
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
@@ -1905,12 +1896,10 @@ ShowPartitionSizeInputBox(SHORT Left,
19051896
*Quit = TRUE;
19061897

19071898
InputBuffer[0] = UNICODE_NULL;
1908-
CONSOLE_SetCursorType(TRUE, FALSE);
19091899
break;
19101900
}
19111901
else if (Ir.Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */
19121902
{
1913-
CONSOLE_SetCursorType(TRUE, FALSE);
19141903
break;
19151904
}
19161905
else if (Ir.Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE) /* ESC */
@@ -1919,7 +1908,6 @@ ShowPartitionSizeInputBox(SHORT Left,
19191908
*Cancel = TRUE;
19201909

19211910
InputBuffer[0] = UNICODE_NULL;
1922-
CONSOLE_SetCursorType(TRUE, FALSE);
19231911
break;
19241912
}
19251913
else if ((Ir.Event.KeyEvent.uChar.AsciiChar == 0x00) &&
@@ -2015,6 +2003,8 @@ ShowPartitionSizeInputBox(SHORT Left,
20152003
}
20162004
}
20172005
}
2006+
2007+
CONSOLE_SetCursorType(TRUE, FALSE);
20182008
}
20192009

20202010

@@ -2152,7 +2142,6 @@ ConfirmDeleteSystemPartitionPage(PINPUT_RECORD Ir)
21522142
{
21532143
if (ConfirmQuit(Ir))
21542144
return QUIT_PAGE;
2155-
21562145
break;
21572146
}
21582147
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */
@@ -2213,7 +2202,6 @@ DeletePartitionPage(PINPUT_RECORD Ir)
22132202
{
22142203
if (ConfirmQuit(Ir))
22152204
return QUIT_PAGE;
2216-
22172205
break;
22182206
}
22192207
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE) /* ESC */
@@ -2470,7 +2458,6 @@ SelectFileSystemPage(
24702458
FsVolContext->NextPageOnAbort = QUIT_PAGE;
24712459
return FSVOL_ABORT;
24722460
}
2473-
24742461
break;
24752462
}
24762463
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE) /* ESC */
@@ -2550,7 +2537,6 @@ FormatPartitionPage(
25502537
FsVolContext->NextPageOnAbort = QUIT_PAGE;
25512538
return FSVOL_ABORT;
25522539
}
2553-
25542540
goto Restart;
25552541
}
25562542
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN || IsUnattendedSetup) /* ENTER */
@@ -2724,10 +2710,7 @@ FsVolCallback(
27242710
FsVolContext->NextPageOnAbort = QUIT_PAGE;
27252711
return FSVOL_ABORT;
27262712
}
2727-
else
2728-
{
2729-
return FSVOL_RETRY;
2730-
}
2713+
return FSVOL_RETRY;
27312714
}
27322715
else if (Ir->Event.KeyEvent.uChar.AsciiChar == VK_RETURN) /* ENTER */
27332716
{
@@ -2777,10 +2760,7 @@ FsVolCallback(
27772760
FsVolContext->NextPageOnAbort = QUIT_PAGE;
27782761
return FSVOL_ABORT;
27792762
}
2780-
else
2781-
{
2782-
return FSVOL_SKIP;
2783-
}
2763+
return FSVOL_SKIP;
27842764
}
27852765
else if (Ir->Event.KeyEvent.uChar.AsciiChar == VK_RETURN) /* ENTER */
27862766
{
@@ -2941,8 +2921,6 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
29412921

29422922
if (ConfirmQuit(Ir))
29432923
return QUIT_PAGE;
2944-
2945-
CONSOLE_SetCursorType(TRUE, TRUE);
29462924
break;
29472925
}
29482926
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
@@ -3559,7 +3537,6 @@ BootLoaderSelectPage(PINPUT_RECORD Ir)
35593537
{
35603538
if (ConfirmQuit(Ir))
35613539
return QUIT_PAGE;
3562-
35633540
break;
35643541
}
35653542
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */

0 commit comments

Comments
 (0)