Simplify array access with references
This commit is contained in:
parent
7d19d1ea2e
commit
7bd3dc5da6
|
@ -743,8 +743,9 @@ std::string Library::getFunctionName(const Token *ftok, bool *error) const
|
|||
for (const Scope *scope = ftok->scope(); scope; scope = scope->nestedIn) {
|
||||
if (!scope->isClassOrStruct())
|
||||
continue;
|
||||
for (unsigned int i = 0; i < scope->definedType->derivedFrom.size(); ++i) {
|
||||
const Type::BaseInfo &baseInfo = scope->definedType->derivedFrom[i];
|
||||
const std::vector<Type::BaseInfo> &derivedFrom = scope->definedType->derivedFrom;
|
||||
for (unsigned int i = 0; i < derivedFrom.size(); ++i) {
|
||||
const Type::BaseInfo &baseInfo = derivedFrom[i];
|
||||
const std::string name(baseInfo.name + "::" + ftok->str());
|
||||
if (functions.find(name) != functions.end() && matchArguments(ftok, name))
|
||||
return name;
|
||||
|
|
|
@ -3680,9 +3680,11 @@ const Enumerator * SymbolDatabase::findEnumerator(const Token * tok) const
|
|||
}
|
||||
|
||||
if (scope->definedType) {
|
||||
for (size_t i = 0, end = scope->definedType->derivedFrom.size(); i < end; ++i) {
|
||||
if (scope->definedType->derivedFrom[i].type && scope->definedType->derivedFrom[i].type->classScope) {
|
||||
enumerator = scope->definedType->derivedFrom[i].type->classScope->findEnumerator(tok->str());
|
||||
const std::vector<Type::BaseInfo> & derivedFrom = scope->definedType->derivedFrom;
|
||||
for (size_t i = 0, end = derivedFrom.size(); i < end; ++i) {
|
||||
const Type *derivedFromType = derivedFrom[i].type;
|
||||
if (derivedFromType && derivedFromType ->classScope) {
|
||||
enumerator = derivedFromType->classScope->findEnumerator(tok->str());
|
||||
|
||||
if (enumerator)
|
||||
return enumerator;
|
||||
|
|
Loading…
Reference in New Issue