Skip to content

Commit 0aacae3

Browse files
Remove unused import and minor reformat
1 parent 22033c4 commit 0aacae3

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

Framework/Indexing/src/IndexInfo.cpp

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "MantidTypes/SpectrumDefinition.h"
1313

1414
#include <algorithm>
15-
#include <functional>
1615
#include <numeric>
1716

1817
namespace Mantid::Indexing {
@@ -100,21 +99,17 @@ const std::vector<SpectrumNumber> &IndexInfo::spectrumNumbers() const {
10099
/// Set a spectrum number for each index.
101100
void IndexInfo::setSpectrumNumbers(std::vector<SpectrumNumber> &&spectrumNumbers) {
102101
if (m_spectrumNumberTranslator->globalSize() != spectrumNumbers.size())
103-
throw std::runtime_error("IndexInfo::setSpectrumNumbers: Size mismatch. "
104-
"The vector must contain a spectrum number for "
105-
"each spectrum (not just for the local "
106-
"partition).");
102+
throw std::runtime_error("IndexInfo::setSpectrumNumbers: Size mismatch. The vector must contain a spectrum number "
103+
"for each spectrum (not just for the local partition).");
107104
makeSpectrumNumberTranslator(std::move(spectrumNumbers));
108105
}
109106

110107
/// Set a contiguous range of spectrum numbers.
111108
void IndexInfo::setSpectrumNumbers(const SpectrumNumber min, const SpectrumNumber max) {
112109
auto newSize = static_cast<int32_t>(max) - static_cast<int32_t>(min) + 1;
113110
if (static_cast<int64_t>(m_spectrumNumberTranslator->globalSize()) != newSize)
114-
throw std::runtime_error("IndexInfo::setSpectrumNumbers: Size mismatch. "
115-
"The range of spectrum numbers must provide a "
116-
"spectrum number for each spectrum (not just for "
117-
"the local partition).");
111+
throw std::runtime_error("IndexInfo::setSpectrumNumbers: Size mismatch. The range of spectrum numbers must provide "
112+
"a spectrum number for each spectrum (not just for the local partition).");
118113
std::vector<SpectrumNumber> specNums(newSize);
119114
std::iota(specNums.begin(), specNums.end(), static_cast<int32_t>(min));
120115
makeSpectrumNumberTranslator(std::move(specNums));
@@ -197,9 +192,8 @@ SpectrumIndexSet IndexInfo::makeIndexSet(const std::vector<GlobalSpectrumIndex>
197192
std::vector<GlobalSpectrumIndex>
198193
IndexInfo::globalSpectrumIndicesFromDetectorIndices(const std::vector<size_t> &detectorIndices) const {
199194
if (!m_spectrumDefinitions)
200-
throw std::runtime_error("IndexInfo::"
201-
"globalSpectrumIndicesFromDetectorIndices -- no "
202-
"spectrum definitions available");
195+
throw std::runtime_error(
196+
"IndexInfo::globalSpectrumIndicesFromDetectorIndices -- no spectrum definitions available");
203197
/*
204198
* We need some way of keeping track of which time indices of given detector
205199
* have a matching mapping. detectorMap holds pairs; first in the pair
@@ -260,26 +254,22 @@ IndexInfo::globalSpectrumIndicesFromDetectorIndices(const std::vector<size_t> &d
260254
}
261255
}
262256
if (spectrumDefinition.first == -2)
263-
throw std::runtime_error("SpectrumDefinition contains multiple entries. "
264-
"No unique mapping from detector to spectrum "
265-
"possible");
257+
throw std::runtime_error(
258+
"SpectrumDefinition contains multiple entries. No unique mapping from detector to spectrum possible");
266259
}
267260

268261
if (std::any_of(detectorMap.begin(), detectorMap.end(),
269262
[](const std::pair<char, std::vector<char>> &p) { return p.first == 1; })) {
270-
throw std::runtime_error("Some of the requested detectors do not have a "
271-
"corresponding spectrum");
263+
throw std::runtime_error("Some of the requested detectors do not have a corresponding spectrum");
272264
}
273265
if (std::any_of(detectorMap.begin(), detectorMap.end(), [](const std::pair<char, std::vector<char>> &p) {
274266
return std::any_of(p.second.begin(), p.second.end(), [](char c) { return c > 1; });
275267
})) {
276-
throw std::runtime_error("Some of the spectra map to the same detector "
277-
"at the same time index");
268+
throw std::runtime_error("Some of the spectra map to the same detector at the same time index");
278269
}
279270

280271
if (detectorIndices.size() > spectrumIndices.size())
281-
throw std::runtime_error("Some of the requested detectors do not have a "
282-
"corresponding spectrum");
272+
throw std::runtime_error("Some of the requested detectors do not have a corresponding spectrum");
283273
return spectrumIndices;
284274
}
285275

0 commit comments

Comments
 (0)