Skip to content

Commit

Permalink
Removed unecessary changes
Browse files Browse the repository at this point in the history
- Deleted unecessary changes that I had made
- Replaced instrument finder by one that already accounts for delimiters and other edge cases
- Removed unecessary notice()

Co-authored-by: Jonathan Haigh <jonathan.haigh@stfc.ac.uk>
  • Loading branch information
GuiMacielPereira and jhaigh0 committed Apr 19, 2024
1 parent 66b381a commit c3291b0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
1 change: 0 additions & 1 deletion Framework/API/src/FileFinder.cpp
Expand Up @@ -286,7 +286,6 @@ std::string FileFinderImpl::makeFileName(const std::string &hint, const Kernel::
filename += suffix;
}

g_log.notice() << "makeFileName(" << hint << ", " << instrument.shortName() << ") = " << filename << ")\n";
return filename;
}

Expand Down
2 changes: 1 addition & 1 deletion Framework/API/src/ISISInstrDataCache.cpp
Expand Up @@ -43,7 +43,7 @@ std::string Mantid::API::ISISInstrDataCache::getFileParentDirPath(std::string fi
std::transform(fileName.begin(), fileName.end(), fileName.begin(), toupper);
std::string instrName = fileName.substr(0, nChars);
try {
auto instrInfo = Kernel::ConfigService::Instance().getInstrument(instrName);
auto instrInfo = FileFinder::Instance().getInstrument(instrName);
instrName = instrInfo.name();
} catch (const Kernel::Exception::NotFoundError &) {
g_log.debug() << "Instrument name not recognized, skipping data cache search ...";
Expand Down
13 changes: 0 additions & 13 deletions Framework/Kernel/src/FacilityInfo.cpp
Expand Up @@ -187,19 +187,6 @@ const InstrumentInfo &FacilityInfo::instrument(std::string iName) const {
[&iName](const auto &inst) { return boost::iequals(inst.shortName(), iName); });
}

// Cover edge case where delimiter is present
if (instrument == m_instruments.cend()) {
instrument = std::find_if(m_instruments.cbegin(), m_instruments.cend(), [&iName](const auto &inst) {
return boost::iequals(inst.name() + inst.delimiter(), iName);
});
}

if (instrument == m_instruments.cend()) {
instrument = std::find_if(m_instruments.cbegin(), m_instruments.cend(), [&iName](const auto &inst) {
return boost::iequals(inst.shortName() + inst.delimiter(), iName);
});
}

if (instrument != m_instruments.cend()) {
g_log.debug() << "Instrument '" << iName << "' found as " << instrument->name() << " at " << name() << ".\n";
return *instrument;
Expand Down

0 comments on commit c3291b0

Please sign in to comment.