@@ -1274,7 +1274,7 @@ CommandObject *CommandInterpreter::GetUserCommandObject(
1274
1274
llvm::StringRef cmd, StringList *matches, StringList *descriptions) const {
1275
1275
std::string cmd_str (cmd);
1276
1276
auto find_exact = [&](const CommandObject::CommandMap &map) {
1277
- auto found_elem = map.find (std::string ( cmd) );
1277
+ auto found_elem = map.find (cmd);
1278
1278
if (found_elem == map.end ())
1279
1279
return (CommandObject *)nullptr ;
1280
1280
CommandObject *exact_cmd = found_elem->second .get ();
@@ -1310,7 +1310,7 @@ CommandObject *CommandInterpreter::GetAliasCommandObject(
1310
1310
llvm::StringRef cmd, StringList *matches, StringList *descriptions) const {
1311
1311
auto find_exact =
1312
1312
[&](const CommandObject::CommandMap &map) -> CommandObject * {
1313
- auto found_elem = map.find (cmd. str () );
1313
+ auto found_elem = map.find (cmd);
1314
1314
if (found_elem == map.end ())
1315
1315
return (CommandObject *)nullptr ;
1316
1316
CommandObject *exact_cmd = found_elem->second .get ();
@@ -1340,13 +1340,12 @@ CommandObject *CommandInterpreter::GetAliasCommandObject(
1340
1340
}
1341
1341
1342
1342
bool CommandInterpreter::CommandExists (llvm::StringRef cmd) const {
1343
- return m_command_dict.find (std::string ( cmd) ) != m_command_dict.end ();
1343
+ return m_command_dict.find (cmd) != m_command_dict.end ();
1344
1344
}
1345
1345
1346
1346
bool CommandInterpreter::GetAliasFullName (llvm::StringRef cmd,
1347
1347
std::string &full_name) const {
1348
- bool exact_match =
1349
- (m_alias_dict.find (std::string (cmd)) != m_alias_dict.end ());
1348
+ bool exact_match = (m_alias_dict.find (cmd) != m_alias_dict.end ());
1350
1349
if (exact_match) {
1351
1350
full_name.assign (std::string (cmd));
1352
1351
return exact_match;
@@ -1374,15 +1373,15 @@ bool CommandInterpreter::GetAliasFullName(llvm::StringRef cmd,
1374
1373
}
1375
1374
1376
1375
bool CommandInterpreter::AliasExists (llvm::StringRef cmd) const {
1377
- return m_alias_dict.find (std::string ( cmd) ) != m_alias_dict.end ();
1376
+ return m_alias_dict.find (cmd) != m_alias_dict.end ();
1378
1377
}
1379
1378
1380
1379
bool CommandInterpreter::UserCommandExists (llvm::StringRef cmd) const {
1381
- return m_user_dict.find (std::string ( cmd) ) != m_user_dict.end ();
1380
+ return m_user_dict.find (cmd) != m_user_dict.end ();
1382
1381
}
1383
1382
1384
1383
bool CommandInterpreter::UserMultiwordCommandExists (llvm::StringRef cmd) const {
1385
- return m_user_mw_dict.find (std::string ( cmd) ) != m_user_mw_dict.end ();
1384
+ return m_user_mw_dict.find (cmd) != m_user_mw_dict.end ();
1386
1385
}
1387
1386
1388
1387
CommandAlias *
@@ -1406,7 +1405,7 @@ CommandInterpreter::AddAlias(llvm::StringRef alias_name,
1406
1405
}
1407
1406
1408
1407
bool CommandInterpreter::RemoveAlias (llvm::StringRef alias_name) {
1409
- auto pos = m_alias_dict.find (std::string ( alias_name) );
1408
+ auto pos = m_alias_dict.find (alias_name);
1410
1409
if (pos != m_alias_dict.end ()) {
1411
1410
m_alias_dict.erase (pos);
1412
1411
return true ;
@@ -1415,7 +1414,7 @@ bool CommandInterpreter::RemoveAlias(llvm::StringRef alias_name) {
1415
1414
}
1416
1415
1417
1416
bool CommandInterpreter::RemoveCommand (llvm::StringRef cmd, bool force) {
1418
- auto pos = m_command_dict.find (std::string ( cmd) );
1417
+ auto pos = m_command_dict.find (cmd);
1419
1418
if (pos != m_command_dict.end ()) {
1420
1419
if (force || pos->second ->IsRemovable ()) {
1421
1420
// Only regular expression objects or python commands are removable under
@@ -1428,8 +1427,7 @@ bool CommandInterpreter::RemoveCommand(llvm::StringRef cmd, bool force) {
1428
1427
}
1429
1428
1430
1429
bool CommandInterpreter::RemoveUser (llvm::StringRef user_name) {
1431
- CommandObject::CommandMap::iterator pos =
1432
- m_user_dict.find (std::string (user_name));
1430
+ CommandObject::CommandMap::iterator pos = m_user_dict.find (user_name);
1433
1431
if (pos != m_user_dict.end ()) {
1434
1432
m_user_dict.erase (pos);
1435
1433
return true ;
@@ -1438,8 +1436,7 @@ bool CommandInterpreter::RemoveUser(llvm::StringRef user_name) {
1438
1436
}
1439
1437
1440
1438
bool CommandInterpreter::RemoveUserMultiword (llvm::StringRef multi_name) {
1441
- CommandObject::CommandMap::iterator pos =
1442
- m_user_mw_dict.find (std::string (multi_name));
1439
+ CommandObject::CommandMap::iterator pos = m_user_mw_dict.find (multi_name);
1443
1440
if (pos != m_user_mw_dict.end ()) {
1444
1441
m_user_mw_dict.erase (pos);
1445
1442
return true ;
@@ -2213,7 +2210,7 @@ const CommandAlias *
2213
2210
CommandInterpreter::GetAlias (llvm::StringRef alias_name) const {
2214
2211
OptionArgVectorSP ret_val;
2215
2212
2216
- auto pos = m_alias_dict.find (std::string ( alias_name) );
2213
+ auto pos = m_alias_dict.find (alias_name);
2217
2214
if (pos != m_alias_dict.end ())
2218
2215
return (CommandAlias *)pos->second .get ();
2219
2216
0 commit comments