Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
205e0368
Commit
205e0368
authored
Nov 04, 2009
by
Roberto Raggi
Browse files
Don't process already visited nodes.
parent
46a7ac5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/FindUsages.cpp
View file @
205e0368
...
...
@@ -59,6 +59,7 @@ void FindUsages::setGlobalNamespaceBinding(NamespaceBindingPtr globalNamespaceBi
QList
<
int
>
FindUsages
::
operator
()(
Symbol
*
symbol
,
Identifier
*
id
,
AST
*
ast
)
{
_processed
.
clear
();
_references
.
clear
();
_declSymbol
=
symbol
;
_id
=
id
;
...
...
@@ -92,6 +93,9 @@ QString FindUsages::matchingLine(const Token &tk) const
void
FindUsages
::
reportResult
(
unsigned
tokenIndex
,
const
QList
<
Symbol
*>
&
candidates
)
{
if
(
_processed
.
contains
(
tokenIndex
))
return
;
const
bool
isStrongResult
=
checkCandidates
(
candidates
);
if
(
isStrongResult
)
...
...
@@ -100,6 +104,11 @@ void FindUsages::reportResult(unsigned tokenIndex, const QList<Symbol *> &candid
void
FindUsages
::
reportResult
(
unsigned
tokenIndex
)
{
if
(
_processed
.
contains
(
tokenIndex
))
return
;
_processed
.
insert
(
tokenIndex
);
const
Token
&
tk
=
tokenAt
(
tokenIndex
);
const
QString
lineText
=
matchingLine
(
tk
);
...
...
src/libs/cplusplus/FindUsages.h
View file @
205e0368
...
...
@@ -114,6 +114,7 @@ private:
QList
<
int
>
_references
;
LookupContext
_previousContext
;
int
_inSimpleDeclaration
;
QSet
<
unsigned
>
_processed
;
};
}
// end of namespace CPlusPlus
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment