[ 
https://issues.apache.org/jira/browse/SOLR-390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537051
 ] 

John Wang commented on SOLR-390:
--------------------------------

I am having problems with "Attach file"
Following is the patch:
Index: 
/Users/john/plum/solr-trunk/src/java/org/apache/solr/search/HashDocSet.java
===================================================================
--- /Users/john/plum/solr-trunk/src/java/org/apache/solr/search/HashDocSet.java 
(revision 587538)
+++ /Users/john/plum/solr-trunk/src/java/org/apache/solr/search/HashDocSet.java 
(working copy)
@@ -17,6 +17,8 @@
 
 package org.apache.solr.search;
 
+import java.util.Arrays;
+
 import org.apache.solr.util.BitUtil;
 
 
@@ -63,8 +65,8 @@
     mask=tsize-1;
 
     table = new int[tsize];
-    for (int i=tsize-1; i>=0; i--) table[i]=EMPTY;
-
+    //for (int i=tsize-1; i>=0; i--) table[i]=EMPTY;
+    Arrays.fill(table, EMPTY);
     for (int i=offset; i<len; i++) {
       put(docs[i]);
     }



> HashDocSet initialization of internal array is not efficient
> ------------------------------------------------------------
>
>                 Key: SOLR-390
>                 URL: https://issues.apache.org/jira/browse/SOLR-390
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>            Reporter: John Wang
>
> HashDocSet initializes the internal array but iterating it instead of using 
> Arrays.fill which is much faster. Patch included

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to