Skip to content

Commit

Permalink
dont copy window filter every iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
lolepop committed Jan 13, 2022
1 parent 916bb8a commit 5ad9d24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ std::unordered_set<std::string> Native::getAllWindows()
return windows;
}

bool Native::isWindowOpen(std::vector<std::string> filter)
bool Native::isWindowOpen(const std::vector<std::string>& filter)
{
auto windows = getAllWindows();
for (auto i = filter.begin(); i != filter.end(); i++)
Expand Down Expand Up @@ -129,7 +129,7 @@ std::unordered_set<std::string> Native::getAllWindows()
return o;
}

bool Native::isWindowOpen(std::vector<std::string> filter)
bool Native::isWindowOpen(const std::vector<std::string>& filter)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
std::unordered_set<std::wstring> f;
Expand Down Expand Up @@ -208,7 +208,7 @@ std::unordered_set<std::string> Native::getAllWindows()
return windows;
}

bool Native::isWindowOpen(std::vector<std::string> filter)
bool Native::isWindowOpen(const std::vector<std::string>& filter)
{
std::unordered_set<std::wstring> f;
std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
Expand Down
2 changes: 1 addition & 1 deletion src/native.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
namespace Native
{
std::unordered_set<std::string> getAllWindows();
bool isWindowOpen(std::vector<std::string> filter);
bool isWindowOpen(const std::vector<std::string>& filter);
}

0 comments on commit 5ad9d24

Please sign in to comment.