mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[MORE] PagePrompt(): Optimize check to load string resources (#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).
This commit is contained in:
parent
cf955094b4
commit
2d655a487e
1 changed files with 5 additions and 4 deletions
|
@ -176,19 +176,20 @@ PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total)
|
||||||
static WCHAR StrLineAt[80] = L"";
|
static WCHAR StrLineAt[80] = L"";
|
||||||
static WCHAR StrOptions[80] = L"";
|
static WCHAR StrOptions[80] = L"";
|
||||||
static WCHAR StrLines[80] = L"";
|
static WCHAR StrLines[80] = L"";
|
||||||
|
static BOOL AreStrLoaded = FALSE;
|
||||||
|
|
||||||
WCHAR szPercent[80] = L"";
|
WCHAR szPercent[80] = L"";
|
||||||
WCHAR szLineAt[80] = L"";
|
WCHAR szLineAt[80] = L"";
|
||||||
|
|
||||||
/* Load the prompt strings */
|
/* Load the prompt strings */
|
||||||
if (!*StrPercent)
|
if (!AreStrLoaded)
|
||||||
|
{
|
||||||
K32LoadStringW(NULL, IDS_CONTINUE_PERCENT, StrPercent, ARRAYSIZE(StrPercent));
|
K32LoadStringW(NULL, IDS_CONTINUE_PERCENT, StrPercent, ARRAYSIZE(StrPercent));
|
||||||
if (!*StrLineAt)
|
|
||||||
K32LoadStringW(NULL, IDS_CONTINUE_LINE_AT, StrLineAt, ARRAYSIZE(StrLineAt));
|
K32LoadStringW(NULL, IDS_CONTINUE_LINE_AT, StrLineAt, ARRAYSIZE(StrLineAt));
|
||||||
if (!*StrOptions)
|
|
||||||
K32LoadStringW(NULL, IDS_CONTINUE_OPTIONS, StrOptions, ARRAYSIZE(StrOptions));
|
K32LoadStringW(NULL, IDS_CONTINUE_OPTIONS, StrOptions, ARRAYSIZE(StrOptions));
|
||||||
if (!*StrLines)
|
|
||||||
K32LoadStringW(NULL, IDS_CONTINUE_LINES, StrLines, ARRAYSIZE(StrLines));
|
K32LoadStringW(NULL, IDS_CONTINUE_LINES, StrLines, ARRAYSIZE(StrLines));
|
||||||
|
AreStrLoaded = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check whether the pager is prompting, but we have actually finished
|
* Check whether the pager is prompting, but we have actually finished
|
||||||
|
|
Loading…
Reference in a new issue