Apply performance-faster-string-find

This commit is contained in:
Alexey Rybalchenko 2021-09-13 12:22:57 +02:00 committed by Dennis Klein
parent f33c597f34
commit 310204a89d
2 changed files with 3 additions and 3 deletions

View File

@ -169,7 +169,7 @@ unordered_map<string, int> ProgOptions::GetChannelInfoImpl() const
for (const auto& m : fVarMap) {
if (boost::regex_match(m.first, re)) {
string chan = m.first.substr(6);
string::size_type n = chan.find(".");
string::size_type n = chan.find('.');
string chanName = chan.substr(0, n);
if (info.find(chanName) == info.end()) {

View File

@ -222,9 +222,9 @@ struct Machine_ : public state_machine_def<Machine_>
bmpl::for_each<AllStates, wrap<bmpl::placeholders::_1>>(get_state_name<RecursiveStt>(stateName, state));
stateName = boost::core::demangle(stateName.c_str());
size_t pos = stateName.rfind(":");
size_t pos = stateName.rfind(':');
stateName = stateName.substr(pos + 1);
size_t pos2 = stateName.rfind("_");
size_t pos2 = stateName.rfind('_');
stateName = stateName.substr(0, pos2);
if (stateName != "OK") {