Commit dacea725dfe1749f8a6d9d0ad7da3b29e9ab0e95
1 parent
db9b70a9
const reference
Showing
1 changed file
with
2 additions
and
2 deletions
src/cxxopts.cpp
| @@ -255,7 +255,7 @@ Options::parse(int& argc, char**& argv) | @@ -255,7 +255,7 @@ Options::parse(int& argc, char**& argv) | ||
| 255 | //short or long option? | 255 | //short or long option? |
| 256 | if (result[4].length() != 0) | 256 | if (result[4].length() != 0) |
| 257 | { | 257 | { |
| 258 | - std::string s = result[4]; | 258 | + const std::string& s = result[4]; |
| 259 | 259 | ||
| 260 | for (int i = 0; i != s.size(); ++i) | 260 | for (int i = 0; i != s.size(); ++i) |
| 261 | { | 261 | { |
| @@ -292,7 +292,7 @@ Options::parse(int& argc, char**& argv) | @@ -292,7 +292,7 @@ Options::parse(int& argc, char**& argv) | ||
| 292 | } | 292 | } |
| 293 | else if (result[1].length() != 0) | 293 | else if (result[1].length() != 0) |
| 294 | { | 294 | { |
| 295 | - std::string name = result[1]; | 295 | + const std::string& name = result[1]; |
| 296 | 296 | ||
| 297 | auto iter = m_options.find(name); | 297 | auto iter = m_options.find(name); |
| 298 | 298 |