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

shellext: pass strings by const reference where possible

Changeset dc7a309ca203

Parent 0009b0c410e1

by Henrik Stuart

Changes to 3 files · Browse files at dc7a309ca203 Showing diff from parent 0009b0c410e1 Diff from another changeset...

 
112
113
114
115
 
116
117
118
 
135
136
137
138
 
139
140
141
 
160
161
162
163
 
164
165
166
 
185
186
187
188
 
189
190
191
 
112
113
114
 
115
116
117
118
 
135
136
137
 
138
139
140
141
 
160
161
162
 
163
164
165
166
 
185
186
187
 
188
189
190
191
@@ -112,7 +112,7 @@
 MenuDescriptionMap MenuDescMap;  MenuIdCmdMap MenuIdMap;   -void AddMenuList(int idCmd, std::string name) +void AddMenuList(int idCmd, std::string const& name)  {   TDEBUG_TRACE("AddMenuList: idCmd = " << idCmd << " name = " << name);   MenuIdMap[idCmd] = MenuDescMap[name]; @@ -135,7 +135,7 @@
 }    void InsertMenuItemWithIcon(HMENU hMenu, int indexMenu, int idCmd, - std::string menuText, std::string iconName) + std::string const& menuText, std::string const& iconName)  {   MENUITEMINFO mi;   mi.cbSize = sizeof(mi); @@ -160,7 +160,7 @@
 }    void InsertSubMenuItemWithIcon(HMENU hMenu, HMENU hSubMenu, int indexMenu, int idCmd, - std::string menuText, std::string iconName) + std::string const& menuText, std::string const& iconName)  {   MENUITEMINFO mi;   mi.cbSize = sizeof(mi); @@ -185,7 +185,7 @@
  InsertMenuItem(hMenu, indexMenu, TRUE, &mi);  }   -void InsertMenuItemByName(HMENU hMenu, std::string name, int indexMenu, +void InsertMenuItemByName(HMENU hMenu, std::string const& name, int indexMenu,   int idCmd, int idCmdFirst)  {   TDEBUG_TRACE("InsertMenuItemByName: name = " << name);
 
42
43
44
45
 
46
47
48
 
49
50
51
 
42
43
44
 
45
46
 
 
47
48
49
50
@@ -42,10 +42,9 @@
 };     -BOOL hasHgDir(std::string path) +BOOL hasHgDir(std::string const& path)  { - path += "\\.hg"; - return PathIsDirectory(path.c_str()); + return PathIsDirectory((path + "\\.hg").c_str());  }    
 
109
110
111
112
 
113
114
115
 
109
110
111
 
112
113
114
115
@@ -109,7 +109,7 @@
     // Cuts the first token off a delimited list -std::string CutFirstToken(std::string& sList, const std::string sDelimiter) +std::string CutFirstToken(std::string& sList, const std::string& sDelimiter)  {   std::string::size_type p = sList.find(sDelimiter);   std::string sResult;