From 1ebeaa20d6709d512f3d84904b40820c427a5c25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Strau=C3=9F?= Date: Thu, 31 Oct 2013 10:36:35 +0100 Subject: [PATCH] Use result iterator for efficiency MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Strauß Signed-off-by: Sven Strickroth --- src/TortoiseGitBlame/PropertiesWnd.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/TortoiseGitBlame/PropertiesWnd.cpp b/src/TortoiseGitBlame/PropertiesWnd.cpp index dd137ca91..0ad657634 100644 --- a/src/TortoiseGitBlame/PropertiesWnd.cpp +++ b/src/TortoiseGitBlame/PropertiesWnd.cpp @@ -260,23 +260,15 @@ void CPropertiesWnd::UpdateProperties(GitRev *pRev) CLogDataVector *pLogEntry = &((CMainFrame*)AfxGetApp()->GetMainWnd())->m_wndOutput.m_LogList.m_logEntries; + CGitHashMap & hashMap = pLogEntry->m_pLogCache->m_HashMap; for (size_t i = 0; i < pRev->m_ParentHash.size(); ++i) { CString str; CString parentsubject; - GitRev *p =NULL; - - if( pLogEntry->m_pLogCache->m_HashMap.find(pRev->m_ParentHash[i]) == pLogEntry->m_pLogCache->m_HashMap.end()) - { - p=NULL; - } - else - { - p= &pLogEntry->m_pLogCache->m_HashMap[pRev->m_ParentHash[i]] ; - } - if(p) - parentsubject=p->GetSubject(); + auto it = hashMap.find(pRev->m_ParentHash[i]); + if (it != hashMap.end()) + parentsubject = it->second.GetSubject(); str.Format(_T("%u - %s\n%s"), i, pRev->m_ParentHash[i].ToString(), parentsubject); @@ -287,7 +279,6 @@ void CPropertiesWnd::UpdateProperties(GitRev *pRev) m_ParentGroup->Expand(); for (int i = 0; i < m_BaseInfoGroup->GetSubItemsCount(); ++i) m_BaseInfoGroup->GetSubItem(i)->SetDescription(m_BaseInfoGroup->GetSubItem(i)->GetValue()); - } else { -- 2.11.4.GIT