diff options
| author | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2014-11-12 11:37:46 +0100 |
|---|---|---|
| committer | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2014-11-12 12:29:58 +0100 |
| commit | e3419dc5ac1ac4f8bf97ead2ddbef94331e00819 (patch) | |
| tree | efc7d75f9029885d6d2bf563a629280601d70be8 /src/libs/cplusplus/CppDocument.cpp | |
| parent | 69504c25cac064461ca34d968f6616f2abaf5c14 (diff) | |
| download | qt-creator-e3419dc5ac1ac4f8bf97ead2ddbef94331e00819.tar.gz | |
C++: Save a Symbol::asScope() call
isScope() calls asScope().
Change-Id: I9ffe3bf2b9cff567b32a59cf27727097642b560b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Diffstat (limited to 'src/libs/cplusplus/CppDocument.cpp')
| -rw-r--r-- | src/libs/cplusplus/CppDocument.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index ce05b77337..6c51ff5f3b 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -509,10 +509,8 @@ QString Document::functionAt(int line, int column, int *lineOpeningDeclaratorPar // Find the enclosing function scope (which might be several levels up, or we might be standing // on it) - Scope *scope; - if (symbol->isScope()) - scope = symbol->asScope(); - else + Scope *scope = symbol->asScope(); + if (!scope) scope = symbol->enclosingScope(); while (scope && !scope->isFunction() ) |
