[hg] main-silver: use ArrayList instead of LinkedList, because A...

  • From: Tomas Hurka < >
  • To:
  • Subject: [hg] main-silver: use ArrayList instead of LinkedList, because A...
  • Date: Mon, 18 Feb 2013 00:50:15 -0800

changeset 346201a59371 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/346201a59371
description:
        use ArrayList instead of LinkedList, because ArrayList consumes less 
memory

diffstat:

 
parsing.lucene/src/org/netbeans/modules/parsing/lucene/DocumentIndexImpl.java 
|  4 ++--
 parsing.lucene/src/org/netbeans/modules/parsing/lucene/LuceneIndex.java      
 |  3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diffs (41 lines):

diff --git 
a/parsing.lucene/src/org/netbeans/modules/parsing/lucene/DocumentIndexImpl.java
 
b/parsing.lucene/src/org/netbeans/modules/parsing/lucene/DocumentIndexImpl.java
--- 
a/parsing.lucene/src/org/netbeans/modules/parsing/lucene/DocumentIndexImpl.java
+++ 
b/parsing.lucene/src/org/netbeans/modules/parsing/lucene/DocumentIndexImpl.java
@@ -46,7 +46,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.LinkedList;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -248,7 +248,7 @@
         assert fieldName != null;
         assert value != null;
         assert kind != null;
-        final List<IndexDocument> result = new LinkedList<IndexDocument>();
+        final List<IndexDocument> result = new ArrayList<IndexDocument>();
         final Query query = Queries.createQuery(fieldName, fieldName, value, 
kind);
         FieldSelector selector = null;
         if (fieldsToLoad != null && fieldsToLoad.length > 0) {
diff --git 
a/parsing.lucene/src/org/netbeans/modules/parsing/lucene/LuceneIndex.java 
b/parsing.lucene/src/org/netbeans/modules/parsing/lucene/LuceneIndex.java
--- a/parsing.lucene/src/org/netbeans/modules/parsing/lucene/LuceneIndex.java
+++ b/parsing.lucene/src/org/netbeans/modules/parsing/lucene/LuceneIndex.java
@@ -58,7 +58,6 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Map;
@@ -1071,7 +1070,7 @@
         }
         
         private Collection<? extends String> getOrphanLock () {
-            final List<String> locks = new LinkedList<String>();
+            final List<String> locks = new ArrayList<String>();
             final String[] content = folder.list();
             if (content != null) {
                 for (String name : content) {

[hg] main-silver: use ArrayList instead of LinkedList, because A...

Tomas Hurka 02/18/2013

<Possible follow-up(s)>

[hg] main-silver: use ArrayList instead of LinkedList, because A...

Tomas Hurka 02/18/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close