forked from qt-creator/qt-creator
C++: Better names for Scope's iterators
Scope::lastMember() was misleading. Change-Id: I953d489b8a2a9b86321f73cad3b7b371c4acf91f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
This commit is contained in:
@@ -1513,7 +1513,7 @@ void CppCompletionAssistProcessor::completeNamespace(CPlusPlus::ClassOrNamespace
|
||||
|
||||
scopesVisited.insert(scope);
|
||||
|
||||
for (Scope::iterator it = scope->firstMember(); it != scope->lastMember(); ++it) {
|
||||
for (Scope::iterator it = scope->memberBegin(); it != scope->memberEnd(); ++it) {
|
||||
Symbol *member = *it;
|
||||
addCompletionItem(member);
|
||||
}
|
||||
@@ -1570,7 +1570,7 @@ void CppCompletionAssistProcessor::addClassMembersToCompletion(Scope *scope, boo
|
||||
|
||||
std::set<Class *> nestedAnonymouses;
|
||||
|
||||
for (Scope::iterator it = scope->firstMember(); it != scope->lastMember(); ++it) {
|
||||
for (Scope::iterator it = scope->memberBegin(); it != scope->memberEnd(); ++it) {
|
||||
Symbol *member = *it;
|
||||
if (member->isFriend()
|
||||
|| member->isQtPropertyDeclaration()
|
||||
|
||||
@@ -141,8 +141,8 @@ static QByteArray idForSymbol(Symbol *symbol)
|
||||
// add the index of this symbol within its enclosing scope
|
||||
// (counting symbols without identifier of the same type)
|
||||
int count = 0;
|
||||
Scope::iterator it = scope->firstMember();
|
||||
while (it != scope->lastMember() && *it != symbol) {
|
||||
Scope::iterator it = scope->memberBegin();
|
||||
while (it != scope->memberEnd() && *it != symbol) {
|
||||
Symbol *val = *it;
|
||||
++it;
|
||||
if (val->identifier() || typeId(val) != uid)
|
||||
|
||||
@@ -353,7 +353,7 @@ void PointerDeclarationFormatter::processIfWhileForStatement(ExpressionAST *expr
|
||||
//
|
||||
// The declaration for 's' will be handled in visit(SimpleDeclarationAST *ast),
|
||||
// so handle declaration for 't' here.
|
||||
Scope::iterator it = block->lastMember() - 1;
|
||||
Scope::iterator it = block->memberEnd() - 1;
|
||||
Symbol *symbol = *it;
|
||||
if (symbol && symbol->asScope()) { // True if there is a "{ ... }" following.
|
||||
--it;
|
||||
|
||||
Reference in New Issue
Block a user