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:
2
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
2
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
@@ -530,7 +530,7 @@ void Bind::enumerator(EnumeratorAST *ast, Enum *symbol)
|
||||
if (ExpressionAST *expr = ast->expression)
|
||||
e->setConstantValue(asStringLiteral(expr->firstToken(), expr->lastToken()));
|
||||
else if (!symbol->isEmpty())
|
||||
calculateConstantValue(*(symbol->lastMember()-1), e, control());
|
||||
calculateConstantValue(*(symbol->memberEnd()-1), e, control());
|
||||
else
|
||||
e->setConstantValue(control()->stringLiteral("0", 1));
|
||||
|
||||
|
||||
6
src/libs/3rdparty/cplusplus/Scope.cpp
vendored
6
src/libs/3rdparty/cplusplus/Scope.cpp
vendored
@@ -238,7 +238,7 @@ Scope::Scope(Clone *clone, Subst *subst, Scope *original)
|
||||
, _startOffset(original->_startOffset)
|
||||
, _endOffset(original->_endOffset)
|
||||
{
|
||||
for (iterator it = original->firstMember(), end = original->lastMember(); it != end; ++it)
|
||||
for (iterator it = original->memberBegin(), end = original->memberEnd(); it != end; ++it)
|
||||
addMember(clone->symbol(*it, subst));
|
||||
}
|
||||
|
||||
@@ -267,11 +267,11 @@ Symbol *Scope::memberAt(unsigned index) const
|
||||
{ return _members ? _members->symbolAt(index) : 0; }
|
||||
|
||||
/// Returns the first Symbol in the scope.
|
||||
Scope::iterator Scope::firstMember() const
|
||||
Scope::iterator Scope::memberBegin() const
|
||||
{ return _members ? _members->firstSymbol() : 0; }
|
||||
|
||||
/// Returns the last Symbol in the scope.
|
||||
Scope::iterator Scope::lastMember() const
|
||||
Scope::iterator Scope::memberEnd() const
|
||||
{ return _members ? _members->lastSymbol() : 0; }
|
||||
|
||||
Symbol *Scope::find(const Identifier *id) const
|
||||
|
||||
8
src/libs/3rdparty/cplusplus/Scope.h
vendored
8
src/libs/3rdparty/cplusplus/Scope.h
vendored
@@ -48,11 +48,11 @@ public:
|
||||
|
||||
typedef Symbol **iterator;
|
||||
|
||||
/// Returns the first Symbol in the scope.
|
||||
iterator firstMember() const;
|
||||
/// Returns member iterator to the beginning.
|
||||
iterator memberBegin() const;
|
||||
|
||||
/// Returns the last Symbol in the scope.
|
||||
iterator lastMember() const;
|
||||
/// Returns member iterator to the end.
|
||||
iterator memberEnd() const;
|
||||
|
||||
Symbol *find(const Identifier *id) const;
|
||||
Symbol *find(OperatorNameId::Kind operatorId) const;
|
||||
|
||||
Reference in New Issue
Block a user