mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-04-11 17:37:22 +10:00
Replacing 'scopeList' contiguous placement of elements in memory more efficient and std::make_unique c++17
Signed-off-by: germanaizek <GermanAizek@yandex.ru>
This commit is contained in:
committed by
ge0rdi
parent
a20215d9da
commit
47cc2b2304
@@ -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)
|
||||
{
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user