Commit 9ab27660 authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #22420 binary_search without sort fastest

parent 511fd283
......@@ -241,11 +241,10 @@ void PredictSatellitePeaks::predictOffsets(
boost::math::iround(1000.0 * satelliteHKL[1]),
boost::math::iround(1000.0 * satelliteHKL[2])};
auto it = find(AlreadyDonePeaks.begin(), AlreadyDonePeaks.end(), SavPk);
if (it == AlreadyDonePeaks.end()) {
bool foundPeak = binary_search(AlreadyDonePeaks.begin(), AlreadyDonePeaks.end(), SavPk);
if (!foundPeak) {
AlreadyDonePeaks.push_back(SavPk);
std::sort(AlreadyDonePeaks.begin(), AlreadyDonePeaks.end());
} else {
continue;
}
......
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