org.sonar.l10n.flex.rules.flex.S1952.html Maven / Gradle / Ivy
Why is this an issue?
It can be expensive to instantiate a new object, and doing so inside a loop is typically an error. Instead, create the object once, before the
loop.
Noncompliant code example
for (var i:int = 0; i < 10; i++) {
var temp:MyObj = new MyObject(); // Noncompliant
//...
}
Compliant solution
var temp:MyObj = new MyObject();
for (var i:int = 0; i < 10; i++) {
//...
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy