Skip to content

Commit aa03023

Browse files
refactor: names is passed by value — prefer const std::vector<std::string>&
With svchost.exe yielding ~78 related processes, this copies all those strings on every call. Since names is only read inside the function, pass by const reference like pids Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 17cc779 commit aa03023

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,7 @@ void FindProcessPorts(DWORD targetPid) {
17271727

17281728

17291729

1730-
void PIDinspect(const std::vector<DWORD>& pids, std::vector<std::string> names) { // ooh guys look i'm in the void
1730+
void PIDinspect(const std::vector<DWORD>& pids, const std::vector<std::string>& names) { // ooh guys look i'm in the void
17311731
DWORD pid = pids[0];
17321732
std::string procName = GetProcessNameFromPid(pid);
17331733
if (IsVirtualTerminalModeEnabled()) {

0 commit comments

Comments
 (0)