Use mappedReduce when searching for the usages of a symbol.

This commit is contained in:
Roberto Raggi
2009-12-04 13:04:20 +01:00
parent 425c61f624
commit aae5b92125
3 changed files with 83 additions and 55 deletions

View File

@@ -41,9 +41,8 @@
using namespace CPlusPlus;
FindUsages::FindUsages(Document::Ptr doc, const Snapshot &snapshot, QFutureInterface<Usage> *future)
FindUsages::FindUsages(Document::Ptr doc, const Snapshot &snapshot)
: ASTVisitor(doc->translationUnit()),
_future(future),
_doc(doc),
_snapshot(snapshot),
_source(_doc->source()),
@@ -131,12 +130,8 @@ void FindUsages::reportResult(unsigned tokenIndex)
const int len = tk.f.length;
const Usage u(_doc->fileName(), line, lineText, col, len);
const Usage u(_doc->fileName(), lineText, line, col, len);
_usages.append(u);
if (_future)
_future->reportResult(u);
_references.append(tokenIndex);
}