forked from qt-creator/qt-creator
C++: use argumentCount in loops in initializer.
argumentCount is a more expensive function, so try to call it only once, esp. in loops. Change-Id: I6f0d420352743ec444487ce3f506ef28e5282d1e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
@@ -381,10 +381,10 @@ void FunctionDeclDefLink::showMarker(CPPEditorWidget *editor)
|
||||
// does consider foo(void) to have one argument
|
||||
static int declaredParameterCount(Function *function)
|
||||
{
|
||||
int c = function->argumentCount();
|
||||
if (c == 0 && function->memberCount() > 0 && function->memberAt(0)->type().type()->isVoidType())
|
||||
int argc = function->argumentCount();
|
||||
if (argc == 0 && function->memberCount() > 0 && function->memberAt(0)->type().type()->isVoidType())
|
||||
return 1;
|
||||
return c;
|
||||
return argc;
|
||||
}
|
||||
|
||||
Q_GLOBAL_STATIC(QRegExp, commentArgNameRegexp)
|
||||
|
||||
Reference in New Issue
Block a user