Skip to content

Commit 47cc2b2

Browse files
GermanAizekge0rdi
authored andcommitted
Replacing 'scopeList' contiguous placement of elements in memory more efficient and std::make_unique c++17
Signed-off-by: germanaizek <[email protected]>
1 parent a20215d commit 47cc2b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Src/StartMenu/StartMenuDLL/SearchManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ void CSearchManager::SearchThread( void )
798798
CSession session;
799799
if (SUCCEEDED(dataSource.OpenFromInitializationString(L"provider=Search.CollatorDSO.1;EXTENDED PROPERTIES=\"Application=Windows\"")) && SUCCEEDED(session.Open(dataSource)))
800800
{
801-
std::list<SearchScope> scopeList;
801+
std::vector<SearchScope> scopeList;
802802

803803
if (searchRequest.bSearchMetroSettings && !m_bMetroSettingsFound)
804804
{
@@ -1104,7 +1104,7 @@ void CSearchManager::SearchThread( void )
11041104
command0.Close();
11051105
continue;
11061106
}
1107-
for (std::list<SearchScope>::iterator it=scopeList.begin();it!=scopeList.end();++it)
1107+
for (auto it=scopeList.begin();it!=scopeList.end();++it)
11081108
{
11091109
if (it->roots.empty())
11101110
continue;
@@ -1122,7 +1122,7 @@ void CSearchManager::SearchThread( void )
11221122
else
11231123
{
11241124
len+=Strcpy(query+len,_countof(query)-len,L" AND System.Search.Store='FILE' AND System.ItemType!='.settingcontent-ms'");
1125-
for (std::list<SearchScope>::iterator it2=scopeList.begin();it2!=it;++it2)
1125+
for (auto it2=scopeList.begin();it2!=it;++it2)
11261126
{
11271127
if (it2->categoryHash==CATEGORY_METROSETTING)
11281128
continue;

Src/Update/DesktopToasts/DesktopNotificationManagerCompat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ namespace DesktopNotificationManagerCompat
168168
ComPtr<IToastNotificationHistory> nativeHistory;
169169
RETURN_IF_FAILED(toastStatics2->get_History(&nativeHistory));
170170

171-
*history = std::unique_ptr<DesktopNotificationHistoryCompat>(new DesktopNotificationHistoryCompat(s_aumid.c_str(), nativeHistory));
171+
*history = std::make_unique<DesktopNotificationHistoryCompat>(s_aumid.c_str(), nativeHistory);
172172
return S_OK;
173173
}
174174

0 commit comments

Comments
 (0)