Skip to content

Commit b77a76e

Browse files
committed
simplify string processing code
1 parent b3d99ed commit b77a76e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

PresentMon/OutputThread.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44

55
#include "PresentMon.hpp"
66
#include "../IntelPresentMon/CommonUtilities/Math.h"
7+
#include "../IntelPresentMon/CommonUtilities/str/String.h"
78

89
#include <algorithm>
910
#include <shlwapi.h>
1011
#include <thread>
1112

13+
using namespace pmon;
14+
1215
static std::thread gThread;
1316
static bool gQuit = false;
1417

@@ -840,13 +843,8 @@ static void PruneOldSwapChainData(
840843
auto processInfo = &pair.second;
841844

842845
// Check if this is DWM process
843-
bool isDwmProcess = false;
844-
std::wstring processName = processInfo->mModuleName;
845-
std::transform(processName.begin(), processName.end(), processName.begin(),
846-
[](wchar_t c) { return (wchar_t) ::towlower(c); });
847-
if (processName.find(L"dwm.exe") != std::wstring::npos) {
848-
isDwmProcess = true;
849-
}
846+
const bool isDwmProcess =
847+
util::str::ToLower(processInfo->mModuleName).contains(L"dwm.exe");
850848

851849
for (auto ii = processInfo->mSwapChain.begin(), ie = processInfo->mSwapChain.end(); ii != ie; ) {
852850
auto swapChainAddress = ii->first;

0 commit comments

Comments
 (0)