05.03., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit c8385d32 authored by Carla Guillen's avatar Carla Guillen

Removing bug

parent 1a435282
......@@ -137,11 +137,30 @@ SMUCNGPerfConfigurator::~SMUCNGPerfConfigurator() {
}
bool endsWith (std::string const &fullString, std::string const &ending) {
if (fullString.length() >= ending.length()) {
return (0 == fullString.compare (fullString.length() - ending.length(), ending.length(), ending));
} else {
return false;
}
if(ending.size() > fullString.size()){
return false;
}
std::size_t last_forward = fullString.find_last_of('/');
std::size_t last_greaterthan = fullString.find_last_of('>');
std::size_t max_pos;
if(last_greaterthan == std::string::npos){ //no >
if(last_forward == std::string::npos) { // no /
return fullString.compare(ending)==0;
} else { // we have /
max_pos = last_forward;
}
} else { // > is present
if(last_forward == std::string::npos) { // no /
max_pos = last_greaterthan;
} else {
max_pos = last_forward > last_greaterthan ? last_forward : last_greaterthan;
}
}
max_pos++; //increment so that we compare the next char.
if(max_pos < fullString.length()){
return 0 == fullString.compare(max_pos, fullString.size() - max_pos, ending);
}
return false;
}
void SMUCNGPerfConfigurator::sensorBase(SMUCSensorBase& s, CFG_VAL config) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment