Skip to content

Commit 2d655a4

Browse files
[MORE] PagePrompt(): Optimize check to load string resources (reactos#7476)
It is useless to check each string individually and to try to load them again. Use a common flag instead. Follow-up to 2dbbfe8 (0.4.15-dev-2691).
1 parent cf95509 commit 2d655a4

File tree

1 file changed

+5
-4
lines changed
  • base/applications/cmdutils/more

1 file changed

+5
-4
lines changed

base/applications/cmdutils/more/more.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,20 @@ PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total)
176176
static WCHAR StrLineAt[80] = L"";
177177
static WCHAR StrOptions[80] = L"";
178178
static WCHAR StrLines[80] = L"";
179+
static BOOL AreStrLoaded = FALSE;
179180

180181
WCHAR szPercent[80] = L"";
181182
WCHAR szLineAt[80] = L"";
182183

183184
/* Load the prompt strings */
184-
if (!*StrPercent)
185+
if (!AreStrLoaded)
186+
{
185187
K32LoadStringW(NULL, IDS_CONTINUE_PERCENT, StrPercent, ARRAYSIZE(StrPercent));
186-
if (!*StrLineAt)
187188
K32LoadStringW(NULL, IDS_CONTINUE_LINE_AT, StrLineAt, ARRAYSIZE(StrLineAt));
188-
if (!*StrOptions)
189189
K32LoadStringW(NULL, IDS_CONTINUE_OPTIONS, StrOptions, ARRAYSIZE(StrOptions));
190-
if (!*StrLines)
191190
K32LoadStringW(NULL, IDS_CONTINUE_LINES, StrLines, ARRAYSIZE(StrLines));
191+
AreStrLoaded = TRUE;
192+
}
192193

193194
/*
194195
* Check whether the pager is prompting, but we have actually finished

0 commit comments

Comments
 (0)