Fix manual array copy

This commit is contained in:
Nelson A. de Oliveira 2013-08-02 21:12:21 -03:00
parent ca60148431
commit 7901e95fac
3 changed files with 5 additions and 20 deletions

View file

@ -78,9 +78,7 @@ public class PoiFiltersHelper {
private void putValues(Map<AmenityType, LinkedHashSet<String>> types, AmenityType tp,String... vls){
LinkedHashSet<String> list = new LinkedHashSet<String>();
for(String v: vls){
list.add(v);
}
Collections.addAll(list, vls);
types.put(tp, list);
}

View file

@ -1,13 +1,6 @@
package net.osmand.plus.views.mapwidgets;
import java.util.Comparator;
import java.util.EnumSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.*;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmandSettings;
@ -63,9 +56,7 @@ public class MapWidgetRegistry {
} else {
LinkedHashSet<String> set = new LinkedHashSet<String>();
visibleElements.put(ms, set);
for(String s : mpf.split(";")){
set.add(s);
}
Collections.addAll(set, mpf.split(";"));
}
}
@ -371,9 +362,7 @@ public class MapWidgetRegistry {
}
public MapWidgetRegInfo required(ApplicationMode... modes){
for(ApplicationMode ms : modes) {
visibleModes.add(ms);
}
Collections.addAll(visibleModes, modes);
return this;
}

View file

@ -337,9 +337,7 @@ public class PropertyValuesHolder implements Cloneable {
int numKeyframes = values.length;
Keyframe keyframes[] = new Keyframe[Math.max(numKeyframes,2)];
mValueType = values[0].getType();
for (int i = 0; i < numKeyframes; ++i) {
keyframes[i] = values[i];
}
System.arraycopy(values, 0, keyframes, 0, numKeyframes);
mKeyframeSet = new KeyframeSet(keyframes);
}