1
0
Fork 0

fix wiresx search, avoid listing same reflector multiple times

if match occurs multiple times along reflector name... and a bit of code cleanup...
ycs232-kbc
narspt 5 years ago committed by GitHub
parent 0e018f1676
commit 5d6554c211
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -313,17 +313,15 @@ std::vector<CYSFReflector*>& CYSFReflectors::search(const std::string& name)
reflector.erase(std::find_if(reflector.rbegin(), reflector.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), reflector.end());
std::transform(reflector.begin(), reflector.end(), reflector.begin(), ::toupper);
// Origional match function - only matches start of string.
// Original match function - only matches start of string.
// if (trimmed == reflector.substr(0U, len))
// m_search.push_back(*it);
// New match function searches the whole string
unsigned int refSrcPos;
for (refSrcPos=0;refSrcPos<reflector.length(); refSrcPos++)
{
if (reflector.substr(refSrcPos,trimmed.length()) == trimmed)
{
for (unsigned int refSrcPos = 0U; refSrcPos < reflector.length(); refSrcPos++) {
if (reflector.substr(refSrcPos, trimmed.length()) == trimmed) {
m_search.push_back(*it);
break;
}
}
}

Loading…
Cancel
Save