Skip to content
Snippets Groups Projects
Commit 7b7802d3 authored by Ivan Medeiros Monteiro's avatar Ivan Medeiros Monteiro
Browse files

fix: load index logic on SegyInputParameters

parent 8bf1a80a
No related branches found
No related tags found
2 merge requests!344Merge slb-master feature branch with master branch,!295perf: avoid loading index during session construction
Pipeline #202010 failed
......@@ -31,10 +31,12 @@ SegyInputParameters::loadOrGenerateIndex() const
std::shared_ptr<segyindex::SegyIndex>
SegyInputParameters::loadOrGenerateIndex(api::SegySession& segySession) const
{
auto index = segySession.getIndex();
if (index == nullptr || !index->isValid() || !index->hasIndexFile()) {
if (index != nullptr && index->hasIndexFile()) {
segySession.loadIndexFile();
}
if (index == nullptr || !index->isValid() || !index->hasIndexFile()) {
if (segysdk::utilities::Environment::instance().shouldGenerateIndex()) {
segySession_.generateIndexFile();
}
......@@ -43,8 +45,7 @@ SegyInputParameters::loadOrGenerateIndex(api::SegySession& segySession) const
}
}
segySession.loadIndexFile();
return index;
return segySession.getIndex();
}
SegyInputParameters::SegyInputParameters(segysdk::api::SegySession& segySession)
......
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