forked from qt-creator/qt-creator
Use a `normal' qmap instead of the qmultimap.
This commit is contained in:
@@ -691,30 +691,20 @@ int CPPQuickFixCollector::startCompletion(TextEditor::ITextEditable *editable)
|
|||||||
candidates.append(takeDeclarationOp);
|
candidates.append(takeDeclarationOp);
|
||||||
candidates.append(splitSimpleDeclarationOp);
|
candidates.append(splitSimpleDeclarationOp);
|
||||||
|
|
||||||
QMultiMap<int, QuickFixOperationPtr> matchedOps;
|
QMap<int, QList<QuickFixOperationPtr> > matchedOps;
|
||||||
|
|
||||||
foreach (QuickFixOperationPtr op, candidates) {
|
foreach (QuickFixOperationPtr op, candidates) {
|
||||||
int priority = op->match(path, _editor->textCursor());
|
int priority = op->match(path, _editor->textCursor());
|
||||||
if (priority != -1)
|
if (priority != -1)
|
||||||
matchedOps.insert(priority, op);
|
matchedOps[priority].append(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMapIterator<int, QuickFixOperationPtr> it(matchedOps);
|
QMapIterator<int, QList<QuickFixOperationPtr> > it(matchedOps);
|
||||||
it.toBack();
|
it.toBack();
|
||||||
if (it.hasPrevious()) {
|
if (it.hasPrevious()) {
|
||||||
it.previous();
|
it.previous();
|
||||||
|
|
||||||
int priority = it.key();
|
_quickFixes = it.value();
|
||||||
_quickFixes.append(it.value());
|
|
||||||
|
|
||||||
while (it.hasPrevious()) {
|
|
||||||
it.previous();
|
|
||||||
|
|
||||||
if (it.key() != priority)
|
|
||||||
break;
|
|
||||||
|
|
||||||
_quickFixes.append(it.value());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! _quickFixes.isEmpty())
|
if (! _quickFixes.isEmpty())
|
||||||
|
|||||||
Reference in New Issue
Block a user