https://git.reactos.org/?p=reactos.git;a=commitdiff;h=13cf4c52f50692587873a…
commit 13cf4c52f50692587873a0e038d1821b79342aec
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Feb 24 10:19:53 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Feb 24 10:19:53 2023 +0900
[USETUP] Speed up DoFileCopy +24% (#5089)
Make STRING_COPYING cached. CORE-18838
---
base/setup/usetup/usetup.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/base/setup/usetup/usetup.c b/base/setup/usetup/usetup.c
index e58638c1a7f..199f3b4a1be 100644
--- a/base/setup/usetup/usetup.c
+++ b/base/setup/usetup/usetup.c
@@ -3650,6 +3650,8 @@ FileCopyCallback(PVOID Context,
}
else if (Notification == SPFILENOTIFY_STARTCOPY)
{
+ static PCSTR s_pszCopying = NULL; /* Cached for speed */
+
/* Display copy message */
ASSERT(Param2 == FILEOP_COPY);
@@ -3658,8 +3660,9 @@ FileCopyCallback(PVOID Context,
if (DstFileName) ++DstFileName;
else DstFileName = FilePathInfo->Target;
- CONSOLE_SetStatusText(MUIGetString(STRING_COPYING),
- DstFileName);
+ if (!s_pszCopying)
+ s_pszCopying = MUIGetString(STRING_COPYING);
+ CONSOLE_SetStatusText(s_pszCopying, DstFileName);
#ifdef __REACTOS__ /* HACK */
DoWatchDestFileName(DstFileName);
#endif