From 7d02c794b7bcc3b1bf29cb6ae00a3bcaba4df141 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 26 Oct 2015 10:15:17 +0100 Subject: [PATCH] System : Removed elements after unique has been called --- ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index 9f6a02340b..a5c1909072 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -392,8 +392,6 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigCaseData* eclipseC cvf::Collection faults; std::vector< RifKeywordAndFilePos > fileKeywords; - std::vector filenamesWithFaults; - for (size_t i = 0; i < this->filenamesWithFaults().size(); i++) { QString faultFilename = this->filenamesWithFaults()[i]; @@ -417,7 +415,9 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigCaseData* eclipseC RigMainGrid* mainGrid = eclipseCase->mainGrid(); mainGrid->setFaults(faults); - std::unique(filenamesWithFaults.begin(), filenamesWithFaults.end()); + std::sort(filenamesWithFaults.begin(), filenamesWithFaults.end()); + std::vector::iterator last = std::unique(filenamesWithFaults.begin(), filenamesWithFaults.end()); + filenamesWithFaults.erase(last, filenamesWithFaults.end()); this->setFilenamesWithFaults(filenamesWithFaults); } @@ -925,8 +925,6 @@ cvf::Vec3d interpolate3DPosition(const std::vector std::vector filteredPositions; filteredPositions.reserve(positions.size()); - bool hasContibFromBelow = false; - bool hasContribFromAbove = false; double minDistFromContribAbove = HUGE_VAL; double minDistFromContribBelow = HUGE_VAL; std::vector contrFromAbove;