Use clear instead of iterating over everything

This commit is contained in:
Magnus Ulf 2015-05-17 09:02:51 +02:00 committed by Olof Larsson
parent 17fa7af792
commit 7751340c72

View File

@ -5,7 +5,6 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
@ -219,12 +218,7 @@ public class Coll<E> implements CollInterface<E>
JsonObject jfrom = (JsonObject)ofrom; JsonObject jfrom = (JsonObject)ofrom;
JsonObject jto = (JsonObject)oto; JsonObject jto = (JsonObject)oto;
// Clear To // Clear To
Iterator<Entry<String, JsonElement>> iter = jto.entrySet().iterator(); jto.entrySet().clear();
while (iter.hasNext())
{
iter.next();
iter.remove();
}
// Copy // Copy
for (Entry<String, JsonElement> entry : jfrom.entrySet()) for (Entry<String, JsonElement> entry : jfrom.entrySet())
{ {