Return-Path: Delivered-To: apmail-lucene-solr-dev-archive@locus.apache.org Received: (qmail 9084 invoked from network); 27 Jun 2007 18:38:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jun 2007 18:38:06 -0000 Received: (qmail 89426 invoked by uid 500); 27 Jun 2007 18:37:56 -0000 Delivered-To: apmail-lucene-solr-dev-archive@lucene.apache.org Received: (qmail 89399 invoked by uid 500); 27 Jun 2007 18:37:56 -0000 Mailing-List: contact solr-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-dev@lucene.apache.org Received: (qmail 89376 invoked by uid 99); 27 Jun 2007 18:37:56 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jun 2007 11:37:56 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [169.229.70.150] (HELO rescomp.berkeley.edu) (169.229.70.150) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jun 2007 11:37:52 -0700 Received: by rescomp.berkeley.edu (Postfix, from userid 1007) id CB20E5B76E; Wed, 27 Jun 2007 11:37:31 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by rescomp.berkeley.edu (Postfix) with ESMTP id A69E47F403 for ; Wed, 27 Jun 2007 11:37:31 -0700 (PDT) Date: Wed, 27 Jun 2007 11:37:31 -0700 (PDT) From: Chris Hostetter To: Solr Dev Subject: Re: svn commit: r551060 - /lucene/solr/trunk/src/java/org/apache/solr/update/DocumentBuilder.java In-Reply-To: <20070627055204.17E941A981A@eris.apache.org> Message-ID: References: <20070627055204.17E941A981A@eris.apache.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org : check for null copyField source, delay some allocations i understanding delaying the allocation of missingFields, but why only a size of 1 once it is allocated? (is this just an assumption thta typically only a few fieldswill be missing? would it make sense to just switch to a LinkedLIst since missingFields is only ever used for iteration?) : - List missingFields = new ArrayList( schema.getRequiredFields().size() ); : + List missingFields = null; : for (SchemaField field : schema.getRequiredFields()) { : if (doc.getField(field.getName() ) == null) { : if (field.getDefaultValue() != null) { : doc.add( field.createField( field.getDefaultValue(), 1.0f ) ); : } else { : + if (missingFields==null) { : + missingFields = new ArrayList(1); : + } -Hoss