Skip to content

Commit

Permalink
Replacing 'scopeList' contiguous placement of elements in memory more…
Browse files Browse the repository at this point in the history
… efficient and std::make_unique c++17

Signed-off-by: germanaizek <GermanAizek@yandex.ru>
  • Loading branch information
GermanAizek authored and ge0rdi committed May 12, 2022
1 parent a20215d commit 47cc2b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Src/StartMenu/StartMenuDLL/SearchManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ void CSearchManager::SearchThread( void )
CSession session;
if (SUCCEEDED(dataSource.OpenFromInitializationString(L"provider=Search.CollatorDSO.1;EXTENDED PROPERTIES=\"Application=Windows\"")) && SUCCEEDED(session.Open(dataSource)))
{
std::list<SearchScope> scopeList;
std::vector<SearchScope> scopeList;

if (searchRequest.bSearchMetroSettings && !m_bMetroSettingsFound)
{
Expand Down Expand Up @@ -1104,7 +1104,7 @@ void CSearchManager::SearchThread( void )
command0.Close();
continue;
}
for (std::list<SearchScope>::iterator it=scopeList.begin();it!=scopeList.end();++it)
for (auto it=scopeList.begin();it!=scopeList.end();++it)
{
if (it->roots.empty())
continue;
Expand All @@ -1122,7 +1122,7 @@ void CSearchManager::SearchThread( void )
else
{
len+=Strcpy(query+len,_countof(query)-len,L" AND System.Search.Store='FILE' AND System.ItemType!='.settingcontent-ms'");
for (std::list<SearchScope>::iterator it2=scopeList.begin();it2!=it;++it2)
for (auto it2=scopeList.begin();it2!=it;++it2)
{
if (it2->categoryHash==CATEGORY_METROSETTING)
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace DesktopNotificationManagerCompat
ComPtr<IToastNotificationHistory> nativeHistory;
RETURN_IF_FAILED(toastStatics2->get_History(&nativeHistory));

*history = std::unique_ptr<DesktopNotificationHistoryCompat>(new DesktopNotificationHistoryCompat(s_aumid.c_str(), nativeHistory));
*history = std::make_unique<DesktopNotificationHistoryCompat>(s_aumid.c_str(), nativeHistory);
return S_OK;
}

Expand Down

0 comments on commit 47cc2b2

Please sign in to comment.