Optimized building of results metadata

Reading results metadata from the first frame of the first step only,
assuming that the results metadata are the same for all steps/frames.
This commit is contained in:
Stein Dale
2015-06-03 11:37:13 +02:00
parent fd571091b4
commit 9eebcb1899

View File

@@ -202,17 +202,16 @@ std::map< RifOdbReader::ResPos, std::map<std::string, std::vector<std::string> >
std::map< ResPos, std::map<std::string, std::vector<std::string> > > resultsMap;
const odb_StepRepository& stepRepository = odb->steps();
odb_StepRepositoryIT sIter(stepRepository);
odb_StepRepositoryIT stepIt(stepRepository);
stepIt.first();
for (sIter.first(); !sIter.isDone(); sIter.next())
{
const odb_Step& step = stepRepository.constGet(sIter.currentKey());
const odb_Step& step = stepRepository.constGet(stepIt.currentKey());
const odb_SequenceFrame& stepFrames = step.frames();
int numFrames = stepFrames.size();
for (int f = 0; f < numFrames; f++)
if (stepFrames.size() > 0)
{
const odb_Frame& frame = stepFrames.constGet(f);
// Optimization: Get results metadata for the first frame of the first step only
const odb_Frame& frame = stepFrames.constGet(0);
const odb_FieldOutputRepository& fieldCon = frame.fieldOutputs();
odb_FieldOutputRepositoryIT fieldConIT(fieldCon);
@@ -256,11 +255,10 @@ std::map< RifOdbReader::ResPos, std::map<std::string, std::vector<std::string> >
break;
}
}
}
}
stepFrames.release(f);
}
}
}
stepFrames.release();
return resultsMap;
}