Skip to content
Snippets Groups Projects
Commit a29fdaf5 authored by RichardWaiteSTFC's avatar RichardWaiteSTFC
Browse files

Add const variables and iterators

parent 4d8a8719
No related branches found
No related tags found
No related merge requests found
...@@ -413,18 +413,18 @@ std::map<std::string, std::string> IndexPeaks::validateInputs() { ...@@ -413,18 +413,18 @@ std::map<std::string, std::string> IndexPeaks::validateInputs() {
} }
// get all runs which have peaksin the table // get all runs which have peaksin the table
bool commonUB = this->getProperty(Prop::COMMONUB); const bool commonUB = this->getProperty(Prop::COMMONUB);
if (commonUB) { if (commonUB) {
auto &allPeaks = ws->getPeaks(); const auto &allPeaks = ws->getPeaks();
std::unordered_map<int, int> peaksPerRun; std::unordered_map<int, int> peaksPerRun;
auto it = allPeaks.begin(); auto it = allPeaks.cbegin();
while (peaksPerRun.size() < 2 && it != allPeaks.end()) { while (peaksPerRun.size() < 2 && it != allPeaks.cend()) {
peaksPerRun[it->getRunNumber()] = 1; peaksPerRun[it->getRunNumber()] = 1;
++it; ++it;
}; };
if (peaksPerRun.size() < 2) { if (peaksPerRun.size() < 2) {
helpMsgs[Prop::COMMONUB] = helpMsgs[Prop::COMMONUB] =
"CommonUBForAll can only be True if there are peaks from more" "CommonUBForAll can only be True if there are peaks from more "
"than one run present in the peaks worksapce"; "than one run present in the peaks worksapce";
}; };
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment