Author: hbelusca
Date: Mon Aug 28 13:51:25 2017
New Revision: 75698
URL:
http://svn.reactos.org/svn/reactos?rev=75698&view=rev
Log:
[USETUP]: Simplify code.
Modified:
branches/setup_improvements/base/setup/usetup/settings.c
Modified: branches/setup_improvements/base/setup/usetup/settings.c
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
==============================================================================
--- branches/setup_improvements/base/setup/usetup/settings.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/settings.c [iso-8859-1] Mon Aug 28
13:51:25 2017
@@ -338,6 +338,8 @@
do
{
+ BOOLEAN FoundId;
+
if (!INF_GetDataField(&Context, 1, &KeyValue))
{
/* FIXME: Handle error! */
@@ -346,21 +348,22 @@
}
DPRINT("KeyValue: %S\n", KeyValue);
- if (wcsstr(ComputerIdentifier, KeyValue))
- {
- INF_FreeData(KeyValue);
- if (!INF_GetDataField(&Context, 0, &KeyName))
- {
- /* FIXME: Handle error! */
- DPRINT("INF_GetDataField() failed\n");
- return NULL;
- }
-
- DPRINT("Computer key: %S\n", KeyName);
- wcscpy(ComputerKey, KeyName);
- INF_FreeData(KeyName);
- }
+ FoundId = !!wcsstr(ComputerIdentifier, KeyValue);
INF_FreeData(KeyValue);
+
+ if (!FoundId)
+ continue;
+
+ if (!INF_GetDataField(&Context, 0, &KeyName))
+ {
+ /* FIXME: Handle error! */
+ DPRINT("INF_GetDataField() failed\n");
+ return NULL;
+ }
+
+ DPRINT("Computer key: %S\n", KeyName);
+ wcscpy(ComputerKey, KeyName);
+ INF_FreeData(KeyName);
} while (SetupFindNextLine(&Context, &Context));
List = CreateGenericList();
@@ -595,6 +598,8 @@
do
{
+ BOOLEAN FoundId;
+
if (!INF_GetDataField(&Context, 1, &KeyValue))
{
/* FIXME: Handle error! */
@@ -603,21 +608,22 @@
}
DPRINT("KeyValue: %S\n", KeyValue);
- if (wcsstr(DisplayIdentifier, KeyValue))
- {
- INF_FreeData(KeyValue);
- if (!INF_GetDataField(&Context, 0, &KeyName))
- {
- /* FIXME: Handle error! */
- DPRINT("INF_GetDataField() failed\n");
- return NULL;
- }
-
- DPRINT("Display key: %S\n", KeyName);
- wcscpy(DisplayKey, KeyName);
- INF_FreeData(KeyName);
- }
+ FoundId = !!wcsstr(DisplayIdentifier, KeyValue);
INF_FreeData(KeyValue);
+
+ if (!FoundId)
+ continue;
+
+ if (!INF_GetDataField(&Context, 0, &KeyName))
+ {
+ /* FIXME: Handle error! */
+ DPRINT("INF_GetDataField() failed\n");
+ return NULL;
+ }
+
+ DPRINT("Display key: %S\n", KeyName);
+ wcscpy(DisplayKey, KeyName);
+ INF_FreeData(KeyName);
} while (SetupFindNextLine(&Context, &Context));
List = CreateGenericList();