[USETUP] Speed up DoFileCopy +24% (#5089)

Make STRING_COPYING cached. CORE-18838
This commit is contained in:
Katayama Hirofumi MZ 2023-02-24 10:19:53 +09:00 committed by GitHub
parent 6d2012ac3b
commit 13cf4c52f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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