Synopsis: | System.arrayCopy is more efficient |
Language: | Java |
Severity Level: | 3 |
Category: | Optimization |
Description: |
Instead of copying data between two arrays, use System.arrayCopy method.
public class Test { public void bar() { int[] a = new int[10]; int[] b = new int[10]; // this will trigger the rule for (int i=0;i<10;i++) { b[i]=a[i]; } } } |