Commit d25cb3a4 authored by Michael Reeves's avatar Michael Reeves

use std::list not QList

std::list is close to QLinkedList behavoir wise.
In particular it matches rules about what operations invalidate iterators.

BUG: 385942
FIXED-IN:1.8
parent a21084b7
...@@ -848,7 +848,7 @@ void calcDiff3LineListTrim( ...@@ -848,7 +848,7 @@ void calcDiff3LineListTrim(
Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC, ManualDiffHelpList* pManualDiffHelpList) Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC, ManualDiffHelpList* pManualDiffHelpList)
{ {
const Diff3Line d3l_empty; const Diff3Line d3l_empty;
d3ll.removeAll(d3l_empty); d3ll.remove(d3l_empty);
Diff3LineList::iterator i3 = d3ll.begin(); Diff3LineList::iterator i3 = d3ll.begin();
Diff3LineList::iterator i3A = d3ll.begin(); Diff3LineList::iterator i3A = d3ll.begin();
...@@ -1108,7 +1108,7 @@ void calcDiff3LineListTrim( ...@@ -1108,7 +1108,7 @@ void calcDiff3LineListTrim(
} }
} }
d3ll.removeAll(d3l_empty); d3ll.remove(d3l_empty);
/* /*
......
...@@ -225,12 +225,14 @@ class Diff3Line ...@@ -225,12 +225,14 @@ class Diff3Line
} }
}; };
class Diff3LineList : public QList<Diff3Line> class Diff3LineList : public std::list<Diff3Line>
{ {
public: public:
bool fineDiff(const e_SrcSelector selector, const LineData* v1, const LineData* v2); bool fineDiff(const e_SrcSelector selector, const LineData* v1, const LineData* v2);
void calcDiff3LineVector(Diff3LineVector& d3lv); void calcDiff3LineVector(Diff3LineVector& d3lv);
void calcWhiteDiff3Lines(const LineData* pldA, const LineData* pldB, const LineData* pldC); void calcWhiteDiff3Lines(const LineData* pldA, const LineData* pldB, const LineData* pldC);
//TODO: Add safety guards to prevent list from getting too large. Same problem as with QLinkedList.
int size() const { return (int)std::list<Diff3Line>::size(); }//safe for small files same limit as exited with QLinkedList. This should ultimatly be removed.
}; };
class Diff3LineVector : public QVector<Diff3Line*> class Diff3LineVector : public QVector<Diff3Line*>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment