[MSPAINT] Use Swap in RegistrySettings::SetMostRecentFile

CORE-19237
This commit is contained in:
Katayama Hirofumi MZ 2023-11-18 11:23:13 +09:00
parent 7c0615fa05
commit a58aee5f5b
2 changed files with 2 additions and 6 deletions

View file

@ -51,7 +51,7 @@ BOOL OpenMailer(HWND hWnd, LPCWSTR pszPathName);
#define RAD2DEG(radian) ((LONG)(((radian) * 180) / M_PI))
template <typename T>
void Swap(T& a, T& b)
inline void Swap(T& a, T& b)
{
T tmp = a;
a = b;

View file

@ -264,11 +264,7 @@ void RegistrySettings::SetMostRecentFile(LPCWSTR szPathName)
iFound = i;
if (iFound >= 0)
{
CStringW tmp = strFiles[i];
strFiles[i] = strFiles[i - 1];
strFiles[i - 1] = tmp;
}
Swap(strFiles[i], strFiles[i - 1]);
}
// If szPathName is not the first item in strFiles, insert it at the top of the list