Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

shellext: use the iterator from find() instead of repeated lookups

Changeset 6b053ed83ab1

Parent 2ec802829059

by Sune Foldager

Changes to one file · Browse files at 6b053ed83ab1 Showing diff from parent 2ec802829059 Diff from another changeset...

 
199
200
201
202
 
203
204
205
 
337
338
339
340
 
341
342
343
 
354
355
356
357
358
359
360
 
361
362
363
364
 
 
365
366
367
 
199
200
201
 
202
203
204
205
 
337
338
339
 
340
341
342
343
 
354
355
356
 
357
358
 
359
360
361
 
 
362
363
364
365
366
@@ -199,7 +199,7 @@
  return;   }   - MenuDescription md = MenuDescMap[name]; + MenuDescription md = iter->second;   AddMenuList(idCmd - idCmdFirst, name);   InsertMenuItemWithIcon(hMenu, indexMenu, idCmd, md.menuText, md.iconName);  } @@ -337,7 +337,7 @@
  MenuIdCmdMap::iterator iter = MenuIdMap.find(idCmd);   if(iter != MenuIdMap.end())   { - DoHgtk(MenuIdMap[idCmd].name); + DoHgtk(iter->second.name);   hr = NOERROR;   }   else @@ -354,14 +354,13 @@
 {   *pszName = 0;   char *psz; - UINT idCmdU = static_cast<UINT>(idCmd)     TDEBUG_TRACE("CShellExt::GetCommandString: idCmd = " << idCmd); - MenuIdCmdMap::iterator iter = MenuIdMap.find(idCmdU); + MenuIdCmdMap::iterator iter = MenuIdMap.find(static_cast<UINT>(idCmd));   if (iter != MenuIdMap.end())   { - TDEBUG_TRACE("CShellExt::GetCommandString: name = " << MenuIdMap[idCmdU].name); - psz = (char*)MenuIdMap[idCmdU].helpText.c_str(); + TDEBUG_TRACE("CShellExt::GetCommandString: name = " << iter->second.name); + psz = (char*)iter->second.helpText.c_str();   }   else   {