aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/CppRewriter.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <[email protected]>2013-03-13 12:51:58 +0100
committerErik Verbruggen <[email protected]>2013-03-15 15:46:09 +0100
commitbdb5142102d2fa569deb0d9d6f71d8f4e2661213 (patch)
tree55bf5d6f8927893bffce9d0179e7b594984b4b34 /src/libs/cplusplus/CppRewriter.cpp
parentfb28c145410b7f9111796655e05003b191bd1dd9 (diff)
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 <[email protected]>
Diffstat (limited to 'src/libs/cplusplus/CppRewriter.cpp')
-rw-r--r--src/libs/cplusplus/CppRewriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libs/cplusplus/CppRewriter.cpp b/src/libs/cplusplus/CppRewriter.cpp
index 1b88ec5a7f0..7a49fd2b410 100644
--- a/src/libs/cplusplus/CppRewriter.cpp
+++ b/src/libs/cplusplus/CppRewriter.cpp
@@ -145,7 +145,7 @@ public:
funTy->setReturnType(rewrite->rewriteType(type->returnType()));
- for (unsigned i = 0; i < type->argumentCount(); ++i) {
+ for (unsigned i = 0, argc = type->argumentCount(); i < argc; ++i) {
Symbol *arg = type->argumentAt(i);
Argument *newArg = control()->newArgument(0, 0);