Bioinformatics/Global alignment: Difference between revisions

Content added Content deleted
m (Reworded a comment.)
m (Slight improvement to code.)
Line 274: Line 274:


std::unordered_set<std::string> shortest;
std::unordered_set<std::string> shortest;
shortest.insert(std::reduce(list.begin(), list.end(), std::string("")));
shortest.emplace(std::reduce(list.begin(), list.end(), std::string("")));


uint64_t shortest_length;
uint64_t shortest_length;
Line 289: Line 289:
if ( candidate.length() < shortest_length ) {
if ( candidate.length() < shortest_length ) {
shortest.clear();
shortest.clear();
shortest.insert(candidate);
shortest.emplace(candidate);
shortest_length = candidate.length();
shortest_length = candidate.length();
} else if ( candidate.length() == shortest_length ) {
} else if ( candidate.length() == shortest_length ) {
shortest.insert(candidate);
shortest.emplace(candidate);
}
}
}
}