]> source.dussan.org Git - gwtquery.git/commitdiff
Replace arraylist by hashset in filter, which should improve better
authorManolo Carrasco <manolo@apache.org>
Mon, 8 Dec 2014 08:44:52 +0000 (09:44 +0100)
committerManolo Carrasco <manolo@apache.org>
Mon, 8 Dec 2014 08:45:57 +0000 (09:45 +0100)
gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngine.java

index 6b6d59216abb9ffd381a8047a6a0b7692965b937..78b69e3eed374d7c8d060d825a6bc2bc8cb4ba0e 100644 (file)
@@ -17,8 +17,7 @@ package com.google.gwt.query.client.impl;
 
 import static com.google.gwt.query.client.GQuery.*;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashSet;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.dom.client.Document;
@@ -178,8 +177,8 @@ public class SelectorEngine implements HasSelector {
       return res;
     }
     Element ghostParent = null;
-    ArrayList<Node> parents = new ArrayList<Node>();
-    List<Node> elmList = new ArrayList<Node>();
+    HashSet<Node> parents = new HashSet<Node>();
+    HashSet<Node> elmList = new HashSet<Node>();
     for (int i = 0, l = nodes.getLength(); i < l; i++) {
       Node e = nodes.getItem(i);
       if (e == window || e == document || e.getNodeName() == null || "html".equalsIgnoreCase(e.getNodeName())) {