All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.flex.rules.flex.S1952.html Maven / Gradle / Ivy

There is a newer version: 2.14.0.5032
Show newest version

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