VrsProviderLiveTest: Replace String concatenation in a loop with usage of a StringBuilder.

This commit is contained in:
Andreas Schildbach 2019-10-29 09:25:59 +01:00
parent 9c92d75353
commit 2cb344495e

View file

@ -256,11 +256,11 @@ public class VrsProviderLiveTest extends AbstractProviderLiveTest {
public void suggestManyLocations() throws Exception {
Random rand = new Random(new Date().getTime());
for (int i = 0; i < 10; i++) {
String s = "";
final StringBuilder s = new StringBuilder();
int len = rand.nextInt(256);
for (int j = 0; j < len; j++) {
char c = (char) ('a' + rand.nextInt(26));
s += c;
s.append(c);
}
final SuggestLocationsResult result = suggestLocations(s);
System.out.print(s + " => ");