mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1933 Observed data: Speed up reading observed data file
This commit is contained in:
parent
e8d04618af
commit
d8ebe508a2
@ -63,14 +63,18 @@ void RifColumnBasedRsmspecParser::parseData(const QString& data)
|
||||
|
||||
std::vector<double> values;
|
||||
|
||||
QString qLine;
|
||||
do
|
||||
{
|
||||
RifRsmspecParserTools::splitLineToDoubles(line, values);
|
||||
if (values.size() != columnCount) break;
|
||||
qLine = QString::fromStdString(line);
|
||||
QStringList entries = qLine.split(" ", QString::SkipEmptyParts);
|
||||
|
||||
if (entries.size() < columnCount) break;
|
||||
|
||||
for (size_t i = 0; i < columnCount; i++)
|
||||
{
|
||||
table[i].values.push_back(values[i]);
|
||||
double entry = entries.at(i).toDouble();
|
||||
table[i].values.push_back(entry);
|
||||
}
|
||||
} while (std::getline(streamData, line));
|
||||
|
||||
|
@ -51,7 +51,7 @@ bool RifKeywordVectorParser::canBeParsed(const QString& data)
|
||||
|
||||
while (streamData.good())
|
||||
{
|
||||
if (line.size() > 1 && line[0] == '-' && line[1] == '-')
|
||||
if (RifRsmspecParserTools::isAComment(line))
|
||||
{
|
||||
std::getline(streamData, line);
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ bool RifRsmspecParserTools::isLineSkippable(const std::string& line)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifRsmspecParserTools::isAComment(const std::string& word)
|
||||
{
|
||||
if (word.size() > 1 && word[0] == '-' && word[1] == '-')
|
||||
if (word.size() > 1 && word.substr(0, 2) == "--")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user